public function propertyChanged($sender, $propertyName, $oldValue, $newValue)
    {
        if (!$sender instanceof MutableAclInterface && !$sender instanceof EntryInterface) {
            throw new \InvalidArgumentException('$sender must be an instance of MutableAclInterface, or EntryInterface.');
        }

        if ($sender instanceof EntryInterface) {
            if (null === $sender->getId()) {
                return;
            }

            $ace = $sender;
            $sender = $ace->getAcl();
        } else {
            $ace = null;
        }

        if (false === $this->propertyChanges->contains($sender)) {
            throw new \InvalidArgumentException('$sender is not being tracked by this provider.');
        }

        $propertyChanges = $this->propertyChanges->offsetGet($sender);
        if (null === $ace) {
            if (isset($propertyChanges[$propertyName])) {
                $oldValue = $propertyChanges[$propertyName][0];
                if ($oldValue === $newValue) {
                    unset($propertyChanges[$propertyName]);
                } else {
                    $propertyChanges[$propertyName] = array($oldValue, $newValue);
                }
            } else {
                $propertyChanges[$propertyName] = array($oldValue, $newValue);
            }
        } else {
            if (!isset($propertyChanges['aces'])) {
                $propertyChanges['aces'] = new \SplObjectStorage();
            }

            $acePropertyChanges = $propertyChanges['aces']->contains($ace) ? $propertyChanges['aces']->offsetGet($ace) : array();

            if (isset($acePropertyChanges[$propertyName])) {
                $oldValue = $acePropertyChanges[$propertyName][0];
                if ($oldValue === $newValue) {
                    unset($acePropertyChanges[$propertyName]);
                } else {
                    $acePropertyChanges[$propertyName] = array($oldValue, $newValue);
                }
            } else {
                $acePropertyChanges[$propertyName] = array($oldValue, $newValue);
            }

            if (count($acePropertyChanges) > 0) {
                $propertyChanges['aces']->offsetSet($ace, $acePropertyChanges);
            } else {
                $propertyChanges['aces']->offsetUnset($ace);

                if (0 === count($propertyChanges['aces'])) {
                    unset($propertyChanges['aces']);
                }
            }
        }

        $this->propertyChanges->offsetSet($sender, $propertyChanges);
    }
public function propertyChanged($sender, $propertyName, $oldValue, $newValue)
    {
        if (!$sender instanceof MutableAclInterface && !$sender instanceof EntryInterface) {
            throw new \InvalidArgumentException('$sender must be an instance of MutableAclInterface, or EntryInterface.');
        }

        if ($sender instanceof EntryInterface) {
            if (null === $sender->getId()) {
                return;
            }

            $ace = $sender;
            $sender = $ace->getAcl();
        } else {
            $ace = null;
        }

        if (false === $this->propertyChanges->contains($sender)) {
            throw new \InvalidArgumentException('$sender is not being tracked by this provider.');
        }

        $propertyChanges = $this->propertyChanges->offsetGet($sender);
        if (null === $ace) {
            if (isset($propertyChanges[$propertyName])) {
                $oldValue = $propertyChanges[$propertyName][0];
                if ($oldValue === $newValue) {
                    unset($propertyChanges[$propertyName]);
                } else {
                    $propertyChanges[$propertyName] = array($oldValue, $newValue);
                }
            } else {
                $propertyChanges[$propertyName] = array($oldValue, $newValue);
            }
        } else {
            if (!isset($propertyChanges['aces'])) {
                $propertyChanges['aces'] = new \SplObjectStorage();
            }

            $acePropertyChanges = $propertyChanges['aces']->contains($ace) ? $propertyChanges['aces']->offsetGet($ace) : array();

            if (isset($acePropertyChanges[$propertyName])) {
                $oldValue = $acePropertyChanges[$propertyName][0];
                if ($oldValue === $newValue) {
                    unset($acePropertyChanges[$propertyName]);
                } else {
                    $acePropertyChanges[$propertyName] = array($oldValue, $newValue);
                }
            } else {
                $acePropertyChanges[$propertyName] = array($oldValue, $newValue);
            }

            if (count($acePropertyChanges) > 0) {
                $propertyChanges['aces']->offsetSet($ace, $acePropertyChanges);
            } else {
                $propertyChanges['aces']->offsetUnset($ace);

                if (0 === count($propertyChanges['aces'])) {
                    unset($propertyChanges['aces']);
                }
            }
        }

        $this->propertyChanges->offsetSet($sender, $propertyChanges);
    }
public function propertyChanged ( $ sender , $ propertyName , $ oldValue , $ newValue ) { if ( ! $ sender instanceof MutableAclInterface && ! $ sender instanceof EntryInterface ) { throw new \ InvalidArgumentException ( '$sender must be an instance of MutableAclInterface, or EntryInterface.' ) ; } if ( $ sender instanceof EntryInterface ) { if ( null === $ sender -> getId ( ) ) { return ; } $ ace = $ sender ; $ sender = $ ace -> getAcl ( ) ; } else { $ ace = null ; } if ( false === $ this -> propertyChanges -> contains ( $ sender ) ) { throw new \ InvalidArgumentException ( '$sender is not being tracked by this provider.' ) ; } $ propertyChanges = $ this -> propertyChanges -> offsetGet ( $ sender ) ; if ( null === $ ace ) { if ( isset ( $ propertyChanges [ $ propertyName ] ) ) { $ oldValue = $ propertyChanges [ $ propertyName ] [ 0 ] ; if ( $ oldValue === $ newValue ) { unset ( $ propertyChanges [ $ propertyName ] ) ; } else { $ propertyChanges [ $ propertyName ] = array ( $ oldValue , $ newValue ) ; } } else { $ propertyChanges [ $ propertyName ] = array ( $ oldValue , $ newValue ) ; } } else { if ( ! isset ( $ propertyChanges [ 'aces' ] ) ) { $ propertyChanges [ 'aces' ] = new \ SplObjectStorage ( ) ; } $ acePropertyChanges = $ propertyChanges [ 'aces' ] -> contains ( $ ace ) ? $ propertyChanges [ 'aces' ] -> offsetGet ( $ ace ) : array ( ) ; if ( isset ( $ acePropertyChanges [ $ propertyName ] ) ) { $ oldValue = $ acePropertyChanges [ $ propertyName ] [ 0 ] ; if ( $ oldValue === $ newValue ) { unset ( $ acePropertyChanges [ $ propertyName ] ) ; } else { $ acePropertyChanges [ $ propertyName ] = array ( $ oldValue , $ newValue ) ; } } else { $ acePropertyChanges [ $ propertyName ] = array ( $ oldValue , $ newValue ) ; } if ( count ( $ acePropertyChanges ) > 0 ) { $ propertyChanges [ 'aces' ] -> offsetSet ( $ ace , $ acePropertyChanges ) ; } else { $ propertyChanges [ 'aces' ] -> offsetUnset ( $ ace ) ; if ( 0 === count ( $ propertyChanges [ 'aces' ] ) ) { unset ( $ propertyChanges [ 'aces' ] ) ; } } } $ this -> propertyChanges -> offsetSet ( $ sender , $ propertyChanges ) ; }
Implementation of PropertyChangedListener.

This allows us to keep track of which values have been changed, so we don't
have to do a full introspection when ->updateAcl() is called.

@param mixed  $sender
@param string $propertyName
@param mixed  $oldValue
@param mixed  $newValue

@throws \InvalidArgumentException
Implementation of PropertyChangedListener .