/** * Get all the User Groups assigned to this Dashboard * @return array */ public function getUserGroups() { $c = $this->modx->newQuery('modUserGroup'); $c->where(array('dashboard' => $this->dashboard->get('id'))); $c->sortby('name', 'ASC'); $usergroups = $this->modx->getCollection('modUserGroup', $c); $list = array(); /** @var modUserGroup $usergroup */ foreach ($usergroups as $usergroup) { $list[] = array($usergroup->get('id'), $usergroup->get('name')); } return $list; }