Skip to content
Permalink
Browse files

SqlBuilder: Fixed loading arguments for left join conditions (#224)

  • Loading branch information...
norbe authored and dg committed Apr 12, 2019
1 parent d81e35e commit a45e10a8e67c81d098b15cc4558df661f8b8eff4
Showing with 10 additions and 0 deletions.
  1. +3 −0 src/Database/Table/SqlBuilder.php
  2. +7 −0 tests/Database/Table/SqlBuilder.parseJoinConditions().phpt
@@ -585,6 +585,9 @@ protected function getSortedJoins(string $table, &$leftJoinDependency, &$tableJo
}
$finalJoins += $tableJoins[$table];
$key = isset($this->aliases[$table]) ? $table : $this->reservedTableNames[$table];
if ($key[0] === '.') {
$key = substr($key, 1);
}
$this->parameters['joinConditionSorted'] += isset($this->parameters['joinCondition'][$key])
? [$table => $this->parameters['joinCondition'][$key]]
: [];
@@ -89,3 +89,10 @@ test(function () use ($context, $driver) {
}
Assert::same([2, 'private'], $sqlBuilder->getParameters());
});
test(function () use ($context) {
$sqlBuilder = new SqlBuilderMock('book', $context);
$sqlBuilder->addJoinCondition('next_volume.author', 'next_volume.author.born >', '2000-01-01');
Assert::same(['2000-01-01'], $sqlBuilder->getParameters());
});

0 comments on commit a45e10a

Please sign in to comment.
You can’t perform that action at this time.