/**
  * @param int|null $idGroup
  *
  * @return array
  */
 public function getData($idGroup = null)
 {
     if (!$idGroup) {
         return [];
     }
     $group = $this->queryContainer->queryGroupById($idGroup)->findOne();
     return [GroupForm::FIELD_TITLE => $group->getName(), GroupForm::FIELD_ROLES => $this->getAvailableRoleListByIdGroup($idGroup)];
 }
Exemple #2
0
 /**
  * @param int $id
  *
  * @throws \Spryker\Zed\Acl\Business\Exception\EmptyEntityException
  *
  * @return \Orm\Zed\Acl\Persistence\SpyAclGroup
  */
 protected function getGroupEntityById($id)
 {
     $entity = $this->queryContainer->queryGroupById($id)->findOne();
     if ($entity === null) {
         throw new EmptyEntityException();
     }
     return $entity;
 }