diff --git a/web/api/app/Controller/GroupsController.php b/web/api/app/Controller/GroupsController.php index 5d19b5d98..f4185fe76 100644 --- a/web/api/app/Controller/GroupsController.php +++ b/web/api/app/Controller/GroupsController.php @@ -170,5 +170,23 @@ class GroupsController extends AppController { 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