src/Repository/DoctrineMongoODM/Event/AbstractUpdatePermissionsSubscriber.php
protected function getEntities($args)
    {
        $dm             = $args->getDocumentManager();
        $resource       = $args->getDocument();
        $repositoryName = $this->getRepositoryName();
        $resourceId     = $resource->getPermissionsResourceId();
        $repository     = $dm->getRepository($repositoryName);
        
        $criteria = array(
            'permissions.assigned.' . $resourceId => array(
                '$exists' => true
            )
        );
        
        $entities = $repository->findBy($criteria);

        return $entities;
    }
protected function getEntities($args)
    {
        $dm             = $args->getDocumentManager();
        $resource       = $args->getDocument();
        $repositoryName = $this->getRepositoryName();
        $resourceId     = $resource->getPermissionsResourceId();
        $repository     = $dm->getRepository($repositoryName);
        
        $criteria = array(
            'permissions.assigned.' . $resourceId => array(
                '$exists' => true
            )
        );
        
        $entities = $repository->findBy($criteria);

        return $entities;
    }
Fetch entities from the database which permissions are assigned the referral document.

@param LifecycleEventArgs $args

@return Collection