I'm having trouble with a findAll() query. I may not fully understand
how associations work, so I'm here for help.
So I've got 3 classes:
Class: Project
Fields: id, name
hasMany: Task
Class: Task
Fields: id, project_id, user_id, name
belongsTo: Project, User
Class: User
Fields: id, name
hasMany: Task
These queries all seem to work just fine [Assume the values I'm
searching are valid]:
$this->Task->findAll(array('User.id' => 1));
$this->Task->findAll(array('Project.id' => 1));
This query never returns any results [Assume the values I'm searching
are valid]:
$this->Project->findall(array('Task.id' => 1));
Is this not available with hasMany? How can I get around this?
Thanks!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---