Repository: QueryInterface is _not_ queryable anymore...

refs #8826
This commit is contained in:
Johannes Meyer 2015-05-18 14:01:17 +02:00
parent 7a6837de0e
commit d39c697d0e
2 changed files with 5 additions and 3 deletions

View File

@ -19,7 +19,7 @@ use Icinga\Util\String;
* <ul>
* <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 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>
*/
abstract class Repository implements Selectable

View File

@ -43,7 +43,6 @@ class RepositoryQuery implements QueryInterface
public function __construct(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)
{
$this->query->from($target, $this->prepareQueryColumns($target, $columns));
$this->query = $this->repository
->getDataSource()
->select()
->from($target, $this->prepareQueryColumns($target, $columns));
$this->target = $target;
return $this;
}