Re: DataObject idea

From: Date: Tue, 19 Dec 2006 01:11:13 +0000
Subject: Re: DataObject idea
References: 1  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-26152@lists.php.net to get a copy of this message
For example, we have two tables like this: 1) table customer: - int id (primary) - string name - int id_state (not null) 2) table state: - int id - string name with dataobject when we have a $CustomerDO object we can get the relative state, but in "mother" with a "state" dataobject we can retrieve all relative customers (is it called "child data"?). Isn't it powerful?
Foreign keys (your id_state) to the state table might appear in many other tables besides customer. To do a reverse lookup you'd need to say which table you want to look up. I think having functions like this would overcomplicate what should be a nice and simple package.
Would be nice to see something in DataObjects.
$state = 'VIC'; $customer->joinAdd($state); $customer->find();

« previous php.pear.general (#26152) next »