Re: Re: Create collections of objects

From: Date: Fri, 15 Feb 2008 15:15:01 +0000
Subject: Re: Re: Create collections of objects
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-269367@lists.php.net to get a copy of this message
Peter Ford <pete@justcroft.com> writes: > Emilio Astarita wrote: >> Hi people, >> > > A static method should still be able to set values of private members. I do > something like: > ... > Thank you, I was not sure how to implement it. Another question. It would be a better approach, making the constructor private? > Then you get an array of elements which match the (possibly wild-carded) > condition, indexed by the element Id (useful for making HTML <select> lists, for > example). > > In fact, I have a base class which implements this by class introspection - > filling the properties of objects which extend it by mapping them to the > database fields... > Good idea. Do you use a script to do mapping or you ask by the fields to the database with the name of the table? Thanks again -- Emilio Astarita <emilio.astarita@gmail.com>

« previous php.general (#269367) next »