Thanks Adam
will give it a go (well, will forward the answer to the person who needed to
know).
Adrian
-Original Message-
From: cake-php@googlegroups.com on behalf of Adam Royle
Sent: Thu 12/6/2007 12:46
To: Cake PHP
Subject: Re: Filtering views to show selected data
Use bindModel() to define the conditions. Something like this...
$this-User-bindModel(array('hasMany' = array('Loan' =
array('conditions' = array('on_loan' = 'L');
$users = $this-User-findAll();
Adam
On Dec 6, 1:17 pm, Gould, Adrian [EMAIL PROTECTED]
wrote:
When retrieving the information for a User, we get associated models, such as
loans.
The view is the Users (for a particulat ID), with hasMany Loans, and
Equipment hasMany Loans.
How can I filter the loans model to give me only those which have been marked
as L for on loan.
User (id, name, password)
Loan (id, user_id, equipment_id, on_loan)
Equipment (id, name)
[have missed created / modified off]
Thanks for the help
Ady
---
Adrian Gould
Lecturer in IT / Network Engineering / Multimedia
Business Finance Computing [Midland Campus]
Swan TAFE
PO BOX 1336, Midland WA 6936
Phone: (08) 9267
eMail: [EMAIL PROTECTED]
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups Cake
PHP group.
To post to this group, send email to cake-php@googlegroups.com
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
-~--~~~~--~~--~--~---