mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-25 23:04:51 +02:00
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)
|
public function from($target, array $columns = null)
|
||||||
{
|
{
|
||||||
$this->query = $this->repository->getDataSource()->select()->from(
|
$this->query = $this->repository->getDataSource()->select();
|
||||||
$this->repository->requireTable($target, $this)
|
$this->query->from($this->repository->requireTable($target, $this));
|
||||||
);
|
|
||||||
$this->query->columns($this->prepareQueryColumns($target, $columns));
|
$this->query->columns($this->prepareQueryColumns($target, $columns));
|
||||||
$this->target = $target;
|
$this->target = $target;
|
||||||
return $this;
|
return $this;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user