Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.50 KB | None | 0 0
  1. // into controller
  2.  
  3. $this->Jobcategory->find('all', array(
  4.     'contains' => array('UsersJobcategory'),
  5.     'recursive' => 1,
  6.     'conditions' => array(
  7.         'UsersJobcategory.type' => 'favorite',
  8.     ),
  9.     'fields' => array(
  10.         'UsersJobcategory.*'
  11.     )
  12. ));
  13.  
  14. // Jobcategory model
  15.  
  16. class Jobcategory extends AppModel {
  17.  
  18.     var $name = 'Jobcategory';
  19.     var $recursive = 1;
  20.    
  21.     var $hasMany = array(
  22.  
  23.             'UsersJobcategory' => array(
  24.                 'className' => 'UsersJobcategory',
  25.                 'foreignKey' => 'jobcategory_id'
  26.             )
  27.     );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement