protected function getPropertyNameWithAlias($propertyPath)
    {
        $aliases = $this->queryBuilder->getRootAliases();
        $previousJoinAlias = $aliases[0];
        if (strpos($propertyPath, '.') === false) {
            return $previousJoinAlias . '.' . $propertyPath;
        }

        $propertyPathParts = explode('.', $propertyPath);
        $conditionPartsCount = count($propertyPathParts);
        for ($i = 0; $i < $conditionPartsCount - 1; $i++) {
            $joinProperty = $previousJoinAlias . '.' . $propertyPathParts[$i];
            $joinAlias = array_search($joinProperty, (array)$this->joins);
            if ($joinAlias === false) {
                $joinAlias = $propertyPathParts[$i] . $this->joinAliasCounter++;
                $this->queryBuilder->leftJoin($joinProperty, $joinAlias);
                $this->joins[$joinAlias] = $joinProperty;
            }
            $previousJoinAlias = $joinAlias;
        }

        return $previousJoinAlias . '.' . $propertyPathParts[$i];
    }
protected function getPropertyNameWithAlias($propertyPath)
    {
        $aliases = $this->queryBuilder->getRootAliases();
        $previousJoinAlias = $aliases[0];
        if (strpos($propertyPath, '.') === false) {
            return $previousJoinAlias . '.' . $propertyPath;
        }

        $propertyPathParts = explode('.', $propertyPath);
        $conditionPartsCount = count($propertyPathParts);
        for ($i = 0; $i < $conditionPartsCount - 1; $i++) {
            $joinProperty = $previousJoinAlias . '.' . $propertyPathParts[$i];
            $joinAlias = array_search($joinProperty, (array)$this->joins);
            if ($joinAlias === false) {
                $joinAlias = $propertyPathParts[$i] . $this->joinAliasCounter++;
                $this->queryBuilder->leftJoin($joinProperty, $joinAlias);
                $this->joins[$joinAlias] = $joinProperty;
            }
            $previousJoinAlias = $joinAlias;
        }

        return $previousJoinAlias . '.' . $propertyPathParts[$i];
    }
protected function getPropertyNameWithAlias ( $ propertyPath ) { $ aliases = $ this -> queryBuilder -> getRootAliases ( ) ; $ previousJoinAlias = $ aliases [ 0 ] ; if ( strpos ( $ propertyPath , '.' ) === false ) { return $ previousJoinAlias . '.' . $ propertyPath ; } $ propertyPathParts = explode ( '.' , $ propertyPath ) ; $ conditionPartsCount = count ( $ propertyPathParts ) ; for ( $ i = 0 ; $ i < $ conditionPartsCount - 1 ; $ i ++ ) { $ joinProperty = $ previousJoinAlias . '.' . $ propertyPathParts [ $ i ] ; $ joinAlias = array_search ( $ joinProperty , ( array ) $ this -> joins ) ; if ( $ joinAlias === false ) { $ joinAlias = $ propertyPathParts [ $ i ] . $ this -> joinAliasCounter ++ ; $ this -> queryBuilder -> leftJoin ( $ joinProperty , $ joinAlias ) ; $ this -> joins [ $ joinAlias ] = $ joinProperty ; } $ previousJoinAlias = $ joinAlias ; } return $ previousJoinAlias . '.' . $ propertyPathParts [ $ i ] ; }
Adds left join clauses along the given property path to the query, if needed.
This enables us to set conditions on related objects.

@param string $propertyPath The path to a sub property, e.g. property.subProperty.foo, or a simple property name
@return string The last part of the property name prefixed by the used join alias, if joins have been added
Adds left join clauses along the given property path to the query if needed . This enables us to set conditions on related objects .