Zepi/Web/AccessControl/src/Manager/GroupManager.php
public function add(EntityInterface $group)
    {
        if (!is_a($group, self::ACCESS_ENTITY_TYPE)) {
            throw new Exception('The given entity (' . get_class($group) . ') is not compatible with this data source (' . self::class . '.');
        }
        
        // If the name of the group already is used we cannot add a new group
        if ($this->accessControlManager->hasAccessEntityForName(self::ACCESS_ENTITY_TYPE, $group->getName())) {
            throw new Exception('Cannot add the group. The name of the group is already in use.');
        }
        
        // Add the access entity
        $uuid = $this->accessControlManager->addAccessEntity($group);
        
        if ($uuid === false) {
            throw new Exception('Cannot add the group. Internal software error.');
        }
        
        return $group;
    }
public function add(EntityInterface $group)
    {
        if (!is_a($group, self::ACCESS_ENTITY_TYPE)) {
            throw new Exception('The given entity (' . get_class($group) . ') is not compatible with this data source (' . self::class . '.');
        }
        
        // If the name of the group already is used we cannot add a new group
        if ($this->accessControlManager->hasAccessEntityForName(self::ACCESS_ENTITY_TYPE, $group->getName())) {
            throw new Exception('Cannot add the group. The name of the group is already in use.');
        }
        
        // Add the access entity
        $uuid = $this->accessControlManager->addAccessEntity($group);
        
        if ($uuid === false) {
            throw new Exception('Cannot add the group. Internal software error.');
        }
        
        return $group;
    }
public function add ( EntityInterface $ group ) { if ( ! is_a ( $ group , self :: ACCESS_ENTITY_TYPE ) ) { throw new Exception ( 'The given entity (' . get_class ( $ group ) . ') is not compatible with this data source (' . self :: class . '.' ) ; } // If the name of the group already is used we cannot add a new group if ( $ this -> accessControlManager -> hasAccessEntityForName ( self :: ACCESS_ENTITY_TYPE , $ group -> getName ( ) ) ) { throw new Exception ( 'Cannot add the group. The name of the group is already in use.' ) ; } // Add the access entity $ uuid = $ this -> accessControlManager -> addAccessEntity ( $ group ) ; if ( $ uuid === false ) { throw new Exception ( 'Cannot add the group. Internal software error.' ) ; } return $ group ; }
Adds the given group to the access entities

@param \Zepi\DataSource\Core\Entity\EntityInterface $group
@return false|\Zepi\Web\AccessControl\Entity\Group

@throws \Zepi\Web\AccessControl\Exception The given entity is not compatible with this data source.
@throws \Zepi\Web\AccessControl\Exception Cannot add the group. The name of the group is already in use.
@throws \Zepi\Web\AccessControl\Exception Cannot add the group. Internal software error.
Adds the given group to the access entities