parent
7a6837de0e
commit
d39c697d0e
|
@ -19,7 +19,7 @@ use Icinga\Util\String;
|
||||||
* <ul>
|
* <ul>
|
||||||
* <li>Concrete implementations need to initialize Repository::$queryColumns</li>
|
* <li>Concrete implementations need to initialize Repository::$queryColumns</li>
|
||||||
* <li>The datasource passed to a repository must implement the Selectable interface</li>
|
* <li>The datasource passed to a repository must implement the Selectable interface</li>
|
||||||
* <li>The datasource must yield an instance of QueryInterface when its select() method is called</li>
|
* <li>The datasource must yield an instance of Queryable when its select() method is called</li>
|
||||||
* </ul>
|
* </ul>
|
||||||
*/
|
*/
|
||||||
abstract class Repository implements Selectable
|
abstract class Repository implements Selectable
|
||||||
|
|
|
@ -43,7 +43,6 @@ class RepositoryQuery implements QueryInterface
|
||||||
public function __construct(Repository $repository)
|
public function __construct(Repository $repository)
|
||||||
{
|
{
|
||||||
$this->repository = $repository;
|
$this->repository = $repository;
|
||||||
$this->query = $repository->getDataSource()->select();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -68,7 +67,10 @@ class RepositoryQuery implements QueryInterface
|
||||||
*/
|
*/
|
||||||
public function from($target, array $columns = null)
|
public function from($target, array $columns = null)
|
||||||
{
|
{
|
||||||
$this->query->from($target, $this->prepareQueryColumns($target, $columns));
|
$this->query = $this->repository
|
||||||
|
->getDataSource()
|
||||||
|
->select()
|
||||||
|
->from($target, $this->prepareQueryColumns($target, $columns));
|
||||||
$this->target = $target;
|
$this->target = $target;
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue