RepositoryQuery: Initialize property $query before requiring a new table
Since $this gets passed to Repository::requireTable() it may be possible that some repository tries to access the underlying native query so we need to ensure that we're able to actually provide it. refs #10567
This commit is contained in:
parent
31b584b338
commit
cf193f2c1b
|
@ -86,9 +86,8 @@ class RepositoryQuery implements QueryInterface, SortRules, FilterColumns, Itera
|
|||
*/
|
||||
public function from($target, array $columns = null)
|
||||
{
|
||||
$this->query = $this->repository->getDataSource()->select()->from(
|
||||
$this->repository->requireTable($target, $this)
|
||||
);
|
||||
$this->query = $this->repository->getDataSource()->select();
|
||||
$this->query->from($this->repository->requireTable($target, $this));
|
||||
$this->query->columns($this->prepareQueryColumns($target, $columns));
|
||||
$this->target = $target;
|
||||
return $this;
|
||||
|
|
Loading…
Reference in New Issue