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
|
@ -170,5 +170,23 @@ class GroupsController extends AppController {
|
||||||
array('action' => 'index')
|
array('action' => 'index')
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} // end function delete
|
} // 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
|
} // end class GroupController
|
||||||
|
|
Loading…
Reference in New Issue