Merge pull request #2928 from pliablepixels/dev
added association method to GroupsController to get Monitor Id/Name o…
This commit is contained in:
commit
85eb525e8f
|
@ -171,4 +171,22 @@ class GroupsController extends AppController {
|
|||
);
|
||||
}
|
||||
} // end function delete
|
||||
|
||||
// returns monitor associations
|
||||
public function associations() {
|
||||
$this->Group->recursive = -1;
|
||||
$groups = $this->Group->find('all', array(
|
||||
'contain'=> array(
|
||||
'Monitor' => array(
|
||||
'fields'=>array('Id','Name')
|
||||
)
|
||||
)
|
||||
)
|
||||
);
|
||||
$this->set(array(
|
||||
'groups' => $groups,
|
||||
'_serialize' => array('groups')
|
||||
));
|
||||
} // end associations
|
||||
|
||||
} // end class GroupController
|
||||
|
|
Loading…
Reference in New Issue