I am writing a function and i would like to call all the site users
who are not being followed by the session user.
I am stuck here since 2 days, could anyone help me here?
function people() {
$options=array(
'fields'=>array('User.id','User.fname','User.lname','User.f_id','Follow.followed_by','Follow.followed_to'),
'joins'=>array(array('table'=>'follows',
'alias'=>'Follow',
'type'=>'left',
'conditions'=>array('Follow.followed_by!='.$this->Session-
>read('Auth.User.id'),'Follow.followed_to=User.id'))),
'group'=>'User.id',
'conditions'=>array('User.f_id'=>1),
);
$this->set('users',$this->User->find('all',$options));
}
--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php
No comments:
Post a Comment