>From your controller: debug($this->ModelName->hasOne) . (You can substitute hasOne for whichever association that you're looking for.)
>From here you can use count()/in_array()/array_values() to perform whatever checks you might want on $this->ModelName- >whateverAssociationYouWant. Or you can get fancy and use the Cake Set class. Remember that when you are defining a model, you are creating a PHP class with methods and member variables, so you can access them like you would any other vanilla PHP class definition. CakePHP is still PHP. -Joel/jperras. On Aug 27, 12:54 pm, MarcS <[EMAIL PROTECTED]> wrote: > Hi, > > I have 2 models, Model1 and Model2. > Is there a way that each Model1 is always associated with at least one > Model2? > > I think I remember seeing this somewhere but I can't find it any more. > > thanks for your help --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
