As equipment owner isn't a static value, don't do it statically. Use beforeFind() to append the condition, or do that in each findAll() call.
--------------------------------------------- Olexandr Melnyk, http://omelnyk.net/ 2007/5/26, hashkash <[EMAIL PROTECTED]>: > > > class User extends AppModel > { > var $name = 'User'; > var $primaryKey = 'username'; > var $hasMany = array ('Equipment'=> > array('className' => 'Equipment', > 'conditions' => > 'Equipment.owner='$logged_in_username', -------->how do I get this > variable > > here?so that i can display only > > the equipment the logged in user own > 'order' => '', > 'limit' => '5', > 'foreignKey' => 'owner', > 'dependent' => false, > 'exclusive' => true, > 'finderQuery' => '' > ) > ); > > > var $validate = array( > 'username' => VALID_NOT_EMPTY, > 'incharge' => VALID_NOT_EMPTY, > 'eqno' => VALID_NOT_EMPTY, > 'type' => VALID_NOT_EMPTY, > ); > } > ?> > > > > > --~--~---------~--~----~------------~-------~--~----~ 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?hl=en -~----------~----~----~----~------~----~------~--~---
