Doctrine/ORM/Listener/RoleHierarchyListener.php
private function invalidateCacheableObject(UnitOfWork $uow, $object)
    {
        $fields = array_keys($uow->getEntityChangeSet($object));
        $checkFields = ['roles'];

        if ($object instanceof RoleHierarchicalInterface || $object instanceof OrganizationUserInterface) {
            $checkFields = array_merge($checkFields, ['name']);
        }

        foreach ($fields as $field) {
            if (\in_array($field, $checkFields, true)) {
                return $this->getPrefix($object);
            }
        }

        return false;
    }
private function invalidateCacheableObject(UnitOfWork $uow, $object)
    {
        $fields = array_keys($uow->getEntityChangeSet($object));
        $checkFields = ['roles'];

        if ($object instanceof RoleHierarchicalInterface || $object instanceof OrganizationUserInterface) {
            $checkFields = array_merge($checkFields, ['name']);
        }

        foreach ($fields as $field) {
            if (\in_array($field, $checkFields, true)) {
                return $this->getPrefix($object);
            }
        }

        return false;
    }
private function invalidateCacheableObject ( UnitOfWork $ uow , $ object ) { $ fields = array_keys ( $ uow -> getEntityChangeSet ( $ object ) ) ; $ checkFields = [ 'roles' ] ; if ( $ object instanceof RoleHierarchicalInterface || $ object instanceof OrganizationUserInterface ) { $ checkFields = array_merge ( $ checkFields , [ 'name' ] ) ; } foreach ( $ fields as $ field ) { if ( \ in_array ( $ field , $ checkFields , true ) ) { return $ this -> getPrefix ( $ object ) ; } } return false ; }
Check if the object cache must be invalidated.

@param UnitOfWork $uow    The unit of work
@param object     $object The object

@return bool|string
Check if the object cache must be invalidated .