private function insertFieldAce($property, $index, $field, $mask, SecurityIdentityInterface $sid, $granting, $strategy = null)
    {
        if (0 === strlen($field)) {
            throw new \InvalidArgumentException('$field cannot be empty.');
        }

        if (!is_int($mask)) {
            throw new \InvalidArgumentException('$mask must be an integer.');
        }

        if (null === $strategy) {
            if (true === $granting) {
                $strategy = PermissionGrantingStrategy::ALL;
            } else {
                $strategy = PermissionGrantingStrategy::ANY;
            }
        }

        $aces = &$this->$property;
        if (!isset($aces[$field])) {
            $aces[$field] = array();
        }

        if ($index < 0 || $index > count($aces[$field])) {
            throw new \OutOfBoundsException(sprintf('The index must be in the interval [0, %d].', count($this->$property)));
        }

        $oldValue = $aces;
        if (isset($aces[$field][$index])) {
            $aces[$field] = array_merge(
                array_slice($aces[$field], 0, $index),
                array(true),
                array_slice($aces[$field], $index)
            );

            for ($i = $index, $c = count($aces[$field]) - 1; $i < $c; ++$i) {
                $this->onEntryPropertyChanged($aces[$field][$i + 1], 'aceOrder', $i, $i + 1);
            }
        }

        $aces[$field][$index] = new FieldEntry(null, $this, $field, $sid, $strategy, $mask, $granting, false, false);
        $this->onPropertyChanged($property, $oldValue, $this->$property);
    }
private function insertFieldAce($property, $index, $field, $mask, SecurityIdentityInterface $sid, $granting, $strategy = null)
    {
        if (0 === strlen($field)) {
            throw new \InvalidArgumentException('$field cannot be empty.');
        }

        if (!is_int($mask)) {
            throw new \InvalidArgumentException('$mask must be an integer.');
        }

        if (null === $strategy) {
            if (true === $granting) {
                $strategy = PermissionGrantingStrategy::ALL;
            } else {
                $strategy = PermissionGrantingStrategy::ANY;
            }
        }

        $aces = &$this->$property;
        if (!isset($aces[$field])) {
            $aces[$field] = array();
        }

        if ($index < 0 || $index > count($aces[$field])) {
            throw new \OutOfBoundsException(sprintf('The index must be in the interval [0, %d].', count($this->$property)));
        }

        $oldValue = $aces;
        if (isset($aces[$field][$index])) {
            $aces[$field] = array_merge(
                array_slice($aces[$field], 0, $index),
                array(true),
                array_slice($aces[$field], $index)
            );

            for ($i = $index, $c = count($aces[$field]) - 1; $i < $c; ++$i) {
                $this->onEntryPropertyChanged($aces[$field][$i + 1], 'aceOrder', $i, $i + 1);
            }
        }

        $aces[$field][$index] = new FieldEntry(null, $this, $field, $sid, $strategy, $mask, $granting, false, false);
        $this->onPropertyChanged($property, $oldValue, $this->$property);
    }
private function insertFieldAce ( $ property , $ index , $ field , $ mask , SecurityIdentityInterface $ sid , $ granting , $ strategy = null ) { if ( 0 === strlen ( $ field ) ) { throw new \ InvalidArgumentException ( '$field cannot be empty.' ) ; } if ( ! is_int ( $ mask ) ) { throw new \ InvalidArgumentException ( '$mask must be an integer.' ) ; } if ( null === $ strategy ) { if ( true === $ granting ) { $ strategy = PermissionGrantingStrategy :: ALL ; } else { $ strategy = PermissionGrantingStrategy :: ANY ; } } $ aces = & $ this -> $ property ; if ( ! isset ( $ aces [ $ field ] ) ) { $ aces [ $ field ] = array ( ) ; } if ( $ index < 0 || $ index > count ( $ aces [ $ field ] ) ) { throw new \ OutOfBoundsException ( sprintf ( 'The index must be in the interval [0, %d].' , count ( $ this -> $ property ) ) ) ; } $ oldValue = $ aces ; if ( isset ( $ aces [ $ field ] [ $ index ] ) ) { $ aces [ $ field ] = array_merge ( array_slice ( $ aces [ $ field ] , 0 , $ index ) , array ( true ) , array_slice ( $ aces [ $ field ] , $ index ) ) ; for ( $ i = $ index , $ c = count ( $ aces [ $ field ] ) - 1 ; $ i < $ c ; ++ $ i ) { $ this -> onEntryPropertyChanged ( $ aces [ $ field ] [ $ i + 1 ] , 'aceOrder' , $ i , $ i + 1 ) ; } } $ aces [ $ field ] [ $ index ] = new FieldEntry ( null , $ this , $ field , $ sid , $ strategy , $ mask , $ granting , false , false ) ; $ this -> onPropertyChanged ( $ property , $ oldValue , $ this -> $ property ) ; }
Inserts a field-based ACE.

@param string                    $property
@param int                       $index
@param string                    $field
@param int                       $mask
@param SecurityIdentityInterface $sid
@param bool                      $granting
@param string                    $strategy

@throws \InvalidArgumentException
@throws \OutOfBoundsException
Inserts a field - based ACE .