Re: DataObjectsFormBuilder - tripleLinks
| From: | Justin Patrin | Date: | Wed, 17 Nov 2004 19:20:14 +0000 |
| Subject: | Re: DataObjectsFormBuilder - tripleLinks | ||
| References: | 1 2 3 4 5 6 7 8 9 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-15607@lists.php.net to get a copy of this message | ||
On Wed, 17 Nov 2004 20:21:46 +0100, Markus Wolff <wolff@21st.de> wrote:
> Justin Patrin wrote:
>
>
> > On Wed, 17 Nov 2004 11:42:00 +0100, Alexander Petri <alex.petri@gmx.de> wrote:
> >><db_name>.links.ini
> >>on the production server the db has another name which was not equal
> >>to the name on my localhost...
> >>i simply renamed them - then it works ;-))
> >
> > This is often a problem. I would suggest symlinking the files. Here's
> > how I do it: I have the ini files in CVS, but in my checked out copy I
> > symlink one to the other (intranet.links.ini linked to
> > intradev.links.ini) so when I change one, the other gets changed. WHen
> > I check them in, it shows up as two files. When I check it out for
> > production, still two files. :-)
>
> Another approach (which we use here) is to modify the generator script
> so that it won't write .ini files anymore. Instead, it generates the
> appropriate keys(), sequenceKey() and table() methods directly into the
> classes, returning the proper arrays for the table.
>
> Not only does this work with any database name, it also gives you the
> ability to make more modular applications without having to edit the
> .ini file or re-run the generator all the time.
>
> Also, it doesn't waste good memory for loading the whole database schema
> even if you're working with only two or three tables.
>
> To get rid of the .links.ini as well, simply introduce a links() method
> in your DataObjects and you're good to go. Same advantages as described
> above.
>
Good point. I actually use these methods for "virtual fields" and
such, which is on the wiki under "Beyond Advanced".
Markus: is there a public patch we could use for this? Has this been
submitted to DB_DataObject as a feature request? This should IMHO be
an option in the generator.
--
Justin Patrin