Skip to content

Commit

Permalink
Merge remote-tracking branch 'remotes/dev/1.6' into 1.6
Browse files Browse the repository at this point in the history
  • Loading branch information
rgrebenchuk committed Jan 20, 2015
2 parents c9d906b + 582022e commit 66565d7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,13 @@ public function getVirtualRelations($className)
/**
* {@inheritdoc}
*/
public function getTargetJoinAlias($className, $fieldName)
public function getTargetJoinAlias($className, $fieldName, $selectFieldName = null)
{
return $this->findProvider($className, $fieldName)->getTargetJoinAlias($className, $fieldName);
return $this->findProvider($className, $fieldName)->getTargetJoinAlias(
$className,
$fieldName,
$selectFieldName
);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function getVirtualRelations($className)
*
* {@inheritdoc}
*/
public function getTargetJoinAlias($className, $fieldName)
public function getTargetJoinAlias($className, $fieldName, $selectFieldName = null)
{
if (!$this->isVirtualRelation($className, $fieldName)) {
throw new \InvalidArgumentException(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,10 @@ public function getVirtualRelations($className);
/**
* Gets a target alias
*
* @param string $className
* @param string $fieldName
* @param string $className
* @param string $fieldName
* @param string|null $selectFieldName
* @return string
*/
public function getTargetJoinAlias($className, $fieldName);
public function getTargetJoinAlias($className, $fieldName, $selectFieldName = null);
}
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,8 @@ protected function addJoinStatements()

$joinTableAlias = $this->aliases[$this->virtualRelationProvider->getTargetJoinAlias(
$className,
$fieldName
$fieldName,
$this->getFieldName($joinId)
)];
}

Expand Down Expand Up @@ -1041,7 +1042,11 @@ protected function addColumnAliasesForVirtualRelation($columnName, array $joinId
$className = $this->getEntityClassName($parentJoinId);

if ($this->virtualRelationProvider->isVirtualRelation($className, $fieldName)) {
$tableAlias = $this->aliases[$this->virtualRelationProvider->getTargetJoinAlias($className, $fieldName)];
$tableAlias = $this->aliases[$this->virtualRelationProvider->getTargetJoinAlias(
$className,
$fieldName,
$this->getFieldName($columnName)
)];
} else {
$joinId = end($joinIds);
$tableAlias = $this->tableAliases[$joinId];
Expand Down Expand Up @@ -1367,8 +1372,6 @@ protected function checkTableAliasInSelect($selectExpr, $alias)
* @param string $alias
* @param int $offset
*
* @todo: use QueryBuilderTools instead
*
* @return bool|int The position of $alias in $condition or FALSE if it was not found
*/
protected function checkTableAliasInCondition($condition, $alias, $offset = 0)
Expand Down

0 comments on commit 66565d7

Please sign in to comment.