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

getSqlForManyToOneAndOneToOneRelationsWithoutPropertyPath() protected method

protected getSqlForManyToOneAndOneToOneRelationsWithoutPropertyPath ( Doctrine\ORM\Query\Filter\SQLFilter $sqlFilter, Doctrine\ORM\Mapping\QuoteStrategy $quoteStrategy, Doctrine\Common\Persistence\Mapping\ClassMetadata $targetEntity, string $targetTableAlias, string $targetEntityPropertyName ) : string
$sqlFilter Doctrine\ORM\Query\Filter\SQLFilter
$quoteStrategy Doctrine\ORM\Mapping\QuoteStrategy
$targetEntity Doctrine\Common\Persistence\Mapping\ClassMetadata
$targetTableAlias string
$targetEntityPropertyName string
return string
    protected function getSqlForManyToOneAndOneToOneRelationsWithoutPropertyPath(DoctrineSqlFilter $sqlFilter, QuoteStrategy $quoteStrategy, ClassMetadata $targetEntity, $targetTableAlias, $targetEntityPropertyName)
    {
        $associationMapping = $targetEntity->getAssociationMapping($targetEntityPropertyName);
        $constraints = [];
        foreach ($associationMapping['joinColumns'] as $joinColumn) {
            $quotedColumnName = $quoteStrategy->getJoinColumnName($joinColumn, $targetEntity, $this->entityManager->getConnection()->getDatabasePlatform());
            $propertyPointer = $targetTableAlias . '.' . $quotedColumnName;
            $operandAlias = $this->operandDefinition;
            if (is_array($this->operandDefinition)) {
                $operandAlias = key($this->operandDefinition);
            }
            $currentReferencedOperandName = $operandAlias . $joinColumn['referencedColumnName'];
            if (is_object($this->operand)) {
                $operandMetadataInfo = $this->entityManager->getClassMetadata(TypeHandling::getTypeForValue($this->operand));
                $currentReferencedValueOfOperand = $operandMetadataInfo->getFieldValue($this->operand, $operandMetadataInfo->getFieldForColumn($joinColumn['referencedColumnName']));
                $this->setParameter($sqlFilter, $currentReferencedOperandName, $currentReferencedValueOfOperand, $associationMapping['type']);
            } elseif (is_array($this->operandDefinition)) {
                foreach ($this->operandDefinition as $operandIterator => $singleOperandValue) {
                    if (is_object($singleOperandValue)) {
                        $operandMetadataInfo = $this->entityManager->getClassMetadata(TypeHandling::getTypeForValue($singleOperandValue));
                        $currentReferencedValueOfOperand = $operandMetadataInfo->getFieldValue($singleOperandValue, $operandMetadataInfo->getFieldForColumn($joinColumn['referencedColumnName']));
                        $this->setParameter($sqlFilter, $operandIterator, $currentReferencedValueOfOperand, $associationMapping['type']);
                    } elseif ($singleOperandValue === null) {
                        $this->setParameter($sqlFilter, $operandIterator, null, $associationMapping['type']);
                    }
                }
            }
            $constraints[] = $this->getConstraintStringForSimpleProperty($sqlFilter, $propertyPointer, $currentReferencedOperandName);
        }
        return ' (' . implode(' ) AND ( ', $constraints) . ') ';
    }