> -----Original Message-----
> From: Christian Schneider [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, January 12, 2005 9:05 PM
> To: Torsten Roehr
> Cc: internals@lists.php.net
> Subject: Re: Get name of extending class with static method call (PHP5)
>
>
> Hey Torsten,
>
> Torsten Roehr wrote:
> > $persons = Person::load($sql); // returns collection of Person objects
> > $cars    = Car::load($sql);    // returns collection of Car objects
>
> Simple solutions:
> 1) $persons = DB::load('Person', $sql); foreach ($persons as $person)...
> 2) $person = new Person($sql); while ($person->iterate())...
> 3) Adding get_class() to all DB classes (like Person) as suggested by
> Daniel Convissor.
>
> Solution 1) is IMHO close enough to your solution. Personally I prefer
> (and we are using) solution 2) here as it also is more space efficient
> for large number of results returned from the DB (only one Person object
> is needed). On top of that we create classes automatically at runtime
> from DB tables which removed the need to write stub classes (and makes
> solution 3) feasible again).
>
> I suggest that we take this discussion off-line now as it is not really
> an internals discussion anymore.
>
> - Chris

Hi Chris,

thank you very much for the proposed solutions - I will take them into
consideration. But the problem still persists and will come up in different
situations, not just in mine.

I am keen to hear some more opinions from other gurus on this list. Thank
you in advance!

Best regards, Torsten Roehr

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to