[controller code]
var $paginate = array(
'fields' => array('*'),
'recursive' => 2,
'limit' => 50,
'order' => array('Port.hardware_unit_id' => 'asc'),
'contain' => array(
'Port' =>
array('HardwareUnit'),'HardwareUnit','Vlan','PortEmploymentGroup')
);
....
function view()
{
$this->set('ports', $this->paginate('Port'));
}
I try to explain it again:
The table "ports" (class: Port) contains the field "uplink_id". This
is a self join from "uplink_id" as foreign-key to the primary key "id"
from table "ports".
Let's assume, a port has "id"=2 and the value from his "uplink_id" is
4. Then i need the HardwareUnit, which is associated with the port
with primary key "id" = 4.
If something is not understandable, simply ask again. My english is
not very well. :/
... and -cricket-, really thanks a lot for your help and patience.
Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions.
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
To unsubscribe from this group, send email to cake-php+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.
No comments:
Post a Comment