private function getResult($entity, Constraint $constraint, array $criteria, ObjectManager $em)
    {
        /** @var UniqueEntity $constraint */
        $filters = SqlFilterUtil::findFilters($em, (array) $constraint->filters, $constraint->allFilters);

        SqlFilterUtil::disableFilters($em, $filters);
        $repository = $em->getRepository(ClassUtils::getClass($entity));
        $result = $repository->{$constraint->repositoryMethod}($criteria);
        SqlFilterUtil::enableFilters($em, $filters);

        if (\is_array($result)) {
            reset($result);
        }

        return $result;
    }
private function getResult($entity, Constraint $constraint, array $criteria, ObjectManager $em)
    {
        /** @var UniqueEntity $constraint */
        $filters = SqlFilterUtil::findFilters($em, (array) $constraint->filters, $constraint->allFilters);

        SqlFilterUtil::disableFilters($em, $filters);
        $repository = $em->getRepository(ClassUtils::getClass($entity));
        $result = $repository->{$constraint->repositoryMethod}($criteria);
        SqlFilterUtil::enableFilters($em, $filters);

        if (\is_array($result)) {
            reset($result);
        }

        return $result;
    }
private function getResult ( $ entity , Constraint $ constraint , array $ criteria , ObjectManager $ em ) { /** @var UniqueEntity $constraint */ $ filters = SqlFilterUtil :: findFilters ( $ em , ( array ) $ constraint -> filters , $ constraint -> allFilters ) ; SqlFilterUtil :: disableFilters ( $ em , $ filters ) ; $ repository = $ em -> getRepository ( ClassUtils :: getClass ( $ entity ) ) ; $ result = $ repository -> { $ constraint -> repositoryMethod } ( $ criteria ) ; SqlFilterUtil :: enableFilters ( $ em , $ filters ) ; if ( \ is_array ( $ result ) ) { reset ( $ result ) ; } return $ result ; }
Get entity result.

@param object        $entity
@param Constraint    $constraint
@param array         $criteria
@param ObjectManager $em

@return array
Get entity result .