Hi lauren,
> Before I finally discovered that there were replies to my
> question :)....I did end up going with a similar solution in order to
> avoid "hackiness".
>
> Which actually brings me to another question:
>
> Should the following work?:
>
> Account has many Purchase
> Purchase belongs to Account
>
> $this->Account->id = 1;
> $this->Account->read();
>
> $this->Account->Purchases->find('unpaid');
there's no 'magic' method called 'unpaid', there's only:
first - grabs a single record
all - grabs all records
threaded - grabs a simple tree
list - gets a name/value pair array
what you want to do is easy though, with a single call, try:
$this->Account->Behaviors->attach('Containable');
$account = $this->Account->find('first', array(
'conditions'=>array('Account.id' => $account_id),
'contain'=>array(
'Payment'=>array('conditions'=>array(
'Payment.status'=>'pending'
)))
));
hth
jon
--
jon bennett
w: http://www.jben.net/
iChat (AIM): jbendotnet Skype: jon-bennett
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---