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++) {
$joinAlias = $propertyPathParts[$i] . $this->joinAliasCounter++;
$this->queryBuilder->leftJoin($previousJoinAlias . '.' . $propertyPathParts[$i], $joinAlias);
$this->joins[$joinAlias] = $previousJoinAlias . '.' . $propertyPathParts[$i];
$previousJoinAlias = $joinAlias;
}
return $previousJoinAlias . '.' . $propertyPathParts[$i];
}