Re: DB_DataObject_FormBuilder and many-many links

From: Date: Tue, 25 May 2004 19:54:35 +0000
Subject: Re: DB_DataObject_FormBuilder and many-many links
References: 1 2 3  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-29666@lists.php.net to get a copy of this message
Hello Justin, I want to make this more stable so it can really get added to FormBuilder. Thanks for your opinions, please keep me supporting with them as actually you seem to be the only one that I can talk about this. I will create a new FormBuilder.php with the latest version from CVS with all the changes we discuss here after we decided on the best way to implement them.
I also think the options should also be in the DO, not in formbuilder. Yep, I'll move them there.
Perhaps this should be _crossLinks? No need for the auto IMHO. Sure. Same for _tripleLinks.
'crosslinktable' should really be only 'table'. Ok. The 'crosslink' prefix had only sense when I started implementing this
(i.e. there was no _crossLinks array that time).
This should also give the full table name, not just the "to" table as naming conventions are not always the same. Ex: 'dvdsSubtitles' or 'dvds_link_subtitles'. Right.
'masterfield' *should* be auto-findable just fine. Of course, it will require checking all of the links entries for the crosslink table. Small price to pay for less config, though. I don't agree on this point. What if for any special reason you want have
additional fields in the crosslink table, and one of them links also back to the main table? You couldn't decide which one to use.. Imagine a table which you use in multiple, very different ways and you need to use different master/detailfields for different purposes (from the same table). I do also agree with you at some level. So what about this? - you _can_ define masterfield/detailfield if you wish - if they are not defined, the _first_ link must specify the masterfield for the table in db.links.ini, the _second_ link must specify the detailfield
'detailfield' should also be auto-findable. I would suggest choosing the first link field other than the masterfield. For auto-finding these two fields, I would suggest making the config options optional but still supported for extreme (or speed consious) cases. Yep. For easier implementation I suggested above to use the first and second
links always. Do you like this?
'masterfield' could be 'from_field'. 'detailfield' could be 'to_field'. master&detailfield sounds more professional to me but from_field and to_field
is maybe easier to understand. Let's call it from_field and to_field then.
With autoTripleLinks, the table should be an option (as outlined above). Yep, I will add it (it was auto-generated until now but it's better to have
it so it can have an arbitrary name).
The fields should be auto-findable, as before. first & second & third links, okay? - the first is the master, the other two
are the details, and there may be any number of additional links (even to the master and detail tables, everything after the third line is ignored here)
The linkedtable1 and 2 fields shouldn't be needed as the links.ini gives these values. 'masterfield' => 'from_field' 'detailfield1' => 'to_field_1' 'detailfield2' => 'to_field_2' I agree.
Regards, Norbert Mocsnik

« previous php.pear.dev (#29666) next »