Ejemplo n.º 1
0
 /**
  * @param array $formData
  *
  * @return \Generated\Shared\Transfer\RolesTransfer
  */
 protected function getRoleTransfersFromForm(array $formData)
 {
     $roles = new RolesTransfer();
     foreach ($formData[GroupForm::FIELD_ROLES] as $idRole) {
         $roleTransfer = (new RoleTransfer())->setIdAclRole($idRole);
         $roles->addRole($roleTransfer);
     }
     return $roles;
 }
Ejemplo n.º 2
0
Archivo: Rule.php Proyecto: spryker/Acl
 /**
  * @param int $idRole
  *
  * @return \Generated\Shared\Transfer\RulesTransfer
  */
 public function getRoleRules($idRole)
 {
     $roleTransfer = new RoleTransfer();
     $roleTransfer->setIdAclRole($idRole);
     $rolesTransfer = new RolesTransfer();
     $rolesTransfer->addRole($roleTransfer);
     $rules = $this->findByRoles($rolesTransfer);
     return $rules;
 }
Ejemplo n.º 3
0
 /**
  * @param int $idGroup
  *
  * @return \Generated\Shared\Transfer\RoleTransfer
  */
 public function getRoles($idGroup)
 {
     $roleCollection = $this->queryContainer->queryGroupRoles($idGroup)->find();
     $roleTransferCollection = new RolesTransfer();
     foreach ($roleCollection as $roleEntity) {
         $roleTransfer = new RoleTransfer();
         $roleTransfer->fromArray($roleEntity->toArray(), true);
         $roleTransferCollection->addRole($roleTransfer);
     }
     return $roleTransferCollection;
 }
Ejemplo n.º 4
0
Archivo: Role.php Proyecto: spryker/Acl
 /**
  * @param int $idGroup
  *
  * @return \Generated\Shared\Transfer\RolesTransfer
  */
 public function getGroupRoles($idGroup)
 {
     $aclRoleEntities = $this->queryContainer->queryGroupRoles($idGroup)->find();
     $rolesTransfer = new RolesTransfer();
     foreach ($aclRoleEntities as $aclRoleEntity) {
         $roleTransfer = new RoleTransfer();
         $roleTransfer->fromArray($aclRoleEntity->toArray(), true);
         $rolesTransfer->addRole($roleTransfer);
     }
     return $rolesTransfer;
 }