Neos\Flow\Security\Authorization\Privilege\Entity\Doctrine\PropertyConditionGenerator::getSubselectQuery PHP Method

getSubselectQuery() protected method

protected getSubselectQuery ( Doctrine\Common\Persistence\Mapping\ClassMetadata $targetEntity, string $targetEntityPropertyName ) : Query
$targetEntity Doctrine\Common\Persistence\Mapping\ClassMetadata
$targetEntityPropertyName string
return Neos\Flow\Persistence\Doctrine\Query
    protected function getSubselectQuery(ClassMetadata $targetEntity, $targetEntityPropertyName)
    {
        $subselectQuery = new Query($targetEntity->getAssociationTargetClass($targetEntityPropertyName));
        $propertyName = str_replace($targetEntityPropertyName . '.', '', $this->path);
        switch ($this->operator) {
            case '==':
                $subselectConstraint = $subselectQuery->equals($propertyName, $this->operand);
                break;
            case '!=':
                $subselectConstraint = $subselectQuery->logicalNot($subselectQuery->equals($propertyName, $this->operand));
                break;
            case '<':
                $subselectConstraint = $subselectQuery->lessThan($propertyName, $this->operand);
                break;
            case '>':
                $subselectConstraint = $subselectQuery->greaterThan($propertyName, $this->operand);
                break;
            case '<=':
                $subselectConstraint = $subselectQuery->lessThanOrEqual($propertyName, $this->operand);
                break;
            case '>=':
                $subselectConstraint = $subselectQuery->greaterThanOrEqual($propertyName, $this->operand);
                break;
            case 'like':
                $subselectConstraint = $subselectQuery->like($propertyName, $this->operand);
                break;
            case 'in':
                $subselectConstraint = $subselectQuery->in($propertyName, $this->operand);
                break;
        }
        $subselectQuery->matching($subselectConstraint);
        return $subselectQuery;
    }