Re: SQL or Cakephp

2007-05-26 Thread Olexandr Melnyk
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 AppMod

Re: SQL or Cakephp

2007-05-25 Thread hashkash
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 va

SQL or Cakephp

2007-05-25 Thread hashkash
HI, I have 2 models User and equipment(the owner is a field in the user table). user hasMany equipment equipment belongsTo user equipment hasOne owner. I need to display all equipment that a user owns when he logs in. Even if I were to specify it in the conditions part of the association how d