Merge pull request #2928 from pliablepixels/dev

added association method to GroupsController to get Monitor Id/Name o…
This commit is contained in:
Isaac Connor 2020-05-05 17:15:52 -04:00 committed by GitHub
commit 85eb525e8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 19 additions and 1 deletions

View File

@ -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