Hello,

I have 2 models connected with this associations:

Waypoint belongsTo WaypointType
WaypointType hasMany Waypoint

I do this:
$this->set('waypoint_types', $this->WaypointType->findAll());

It gives me all WaypointTypes with _all_ associated Waypoints. But I
want obtain only associated Waypoints with is_valid field set to
"yes". Is this possible?

I try add condition:
$this->set('waypoint_types', $this->WaypointType->findAll("Waypoint.is_valid = 
'yes'"));

but it generates invalid SQL query:

SELECT `WaypointType`.`id`,
`WaypointType`.`name`, `WaypointType`.`description` FROM
`waypoint_types` AS `WaypointType` WHERE `Waypoint`.`is_valid` = 'yes'

-- 
Best Regards
 pointer


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to