Hi again Shannah,
Thanks for the patch for the earlier issue -- I just saw your post now and will try it out and let you know if it works for me.
I have a very general question about the API and am seeking your advice. It's pretty easy and should only take you the length of time to read this to respond. I'm integrating a Dataface-run database with an Expression Engine site's membership database. I'm using triggers in Dataface to write changes to the EE MYSQL database directly. I had to be careful to inspect the EE code well to see exactly what it would do on different actions, and replicate that in my code in the triggers. That was tedious, but I've been successful.
Now I am coding it for the other direction, so that when a change is made in EE, it's reflected in the Dataface database. This is actually the easier job, in part because EE has some well-documented triggers already placed at all the vital points I require and in part because you have a great API with which to work with the Dataface database (score one for open source coding!). I just need to figure out how to insert/modify/delete the records in the Dataface database. Keeping in mind that I have relationships on the Dataface side for which I need to maintain referential integrity, three possibilities come to mind:
1. Write (add/modify/delete) directly to the database, ie. using PHP and mysql queries. For relationships, I would search first for relationships and modify/delete them accordingly. A bit long-winded, not the most elegant, but I know I can do it.
2. By giving a complete URI to Dataface to process, eg: http://www.thesite.net/database/index.php?MasterID=3262&-table=Master_Contact_List&-action=delete&-cursor=0&-limit=30&-delete-one=1
I'm not clear on how this would work but I believe it is possible, and it seems to me to be the simplest method, since it would take care of the relationships automatically, since that's in your code. Let me know if this is possible and if you recommend it.
3. Use the API. eg. the records object and some of the methods as you've documented them (and others that I see are not yet documented). The problem here is simply that I'm a bit early -- I'm having a hard time figuring out what to use considering the documentation on this is very young, AND this is my first exposure to OO in PHP and really to programming in OO at all, so it's a bit steep for me and I'm on a tight deadline. For example, I would want a way to delete a record, and any relationships of that record. I can't figure out if there is a method to do this automatically. If so, that'd be great (let me know!). If not, I realize I could use the method to obtain an array of relationships for a given record, and then delete each one using a separate delete method, but that does seem less preferable to option #2 above.
Ultimately I'd like know which of the above 3 methods you would recommend, or if there's something else I'm missing. In short, I just need to be able to delete records (and their relationships), modify records (and their relationships), and add records (no relationships).
Any advice you can offer me would be truly appreciated.
Happy Friday to you
Shiraz