protected function arrayContainsObject(array $array, $object, $identifier)
    {
        if (in_array($object, $array, true) === true) {
            return true;
        }

        foreach ($array as $value) {
            if ($value instanceof $object && $this->persistenceSession->getIdentifierByObject($value) === $identifier) {
                return true;
            }
        }

        return false;
    }
protected function arrayContainsObject(array $array, $object, $identifier)
    {
        if (in_array($object, $array, true) === true) {
            return true;
        }

        foreach ($array as $value) {
            if ($value instanceof $object && $this->persistenceSession->getIdentifierByObject($value) === $identifier) {
                return true;
            }
        }

        return false;
    }
protected function arrayContainsObject ( array $ array , $ object , $ identifier ) { if ( in_array ( $ object , $ array , true ) === true ) { return true ; } foreach ( $ array as $ value ) { if ( $ value instanceof $ object && $ this -> persistenceSession -> getIdentifierByObject ( $ value ) === $ identifier ) { return true ; } } return false ; }
Checks whether the given object is contained in the array. This checks
for object identity in terms of the persistence layer, i.e. the UUID,
when comparing entities.

@param array $array
@param object $object
@param string $identifier
@return boolean
Checks whether the given object is contained in the array . This checks for object identity in terms of the persistence layer i . e . the UUID when comparing entities .