[Phpwm] symfony related records
public.darren.beale at siftware.co.uk
Fri Feb 8 18:43:05 GMT 2008
> Anyone else using the Symfony framework?
> If so, how do you deal with related records that are several tables
> away in the model? For example, say I have the following structure:
This is as much propel as Symfony.
In a related Peer (do stuff with database) class, let's say
lib/model/ItemPeer.php add a new method:
public static function getOrderItemsByUserId($id)
$c = new Criteria();
Within your action you can then call
$orderItems = ItemPeer::getOrderItemsByUserId($id);
If you're in _dev mode you should be able to see that this has given you a
simple 3 table join where user.id = $id.
hth, I've not checked this through but the jist is right
1 North Works
t: 01684 59 49 59
m: 07711 716 197
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.516 / Virus Database: 269.19.21/1265 - Release Date: 07/02/2008
More information about the Phpwm