Guest User

Untitled

a guest
Jul 21st, 2018
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.55 KB | None | 0 0
  1.     function getsomestuff($id = null) {
  2.    
  3.         if(!empty($id)) {
  4.        
  5.             $this->recursive = -1;
  6.             $users = $this->find('all', array(
  7.                                     'conditions' => array(
  8.                                         'User.retailer_id' => $id,
  9.                                         'User.role_id' => 6,
  10.                                     ),
  11.                                     'fields' => array(
  12.                                         'User.id',
  13.                                         'User.firstname',
  14.                                         'User.lastname',
  15.                                     ),
  16.                                 )
  17.                             );
  18.                            
  19.             return Set::combine($users, '{n}.User.id', array('{0} {1} {2}', '{n}.User.firstname', '{n}.User.lastname'));                           
  20.                
  21.         }
  22.        
  23.         return array();    
  24.    
  25.     }
Add Comment
Please, Sign In to add comment