Skip to content

Commit

Permalink
Repository: QueryInterface is _not_ queryable anymore...
Browse files Browse the repository at this point in the history
refs #8826
  • Loading branch information
Johannes Meyer committed May 18, 2015
1 parent 7a6837d commit d39c697
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion library/Icinga/Repository/Repository.php
Expand Up @@ -19,7 +19,7 @@
* <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
Expand Down
6 changes: 4 additions & 2 deletions library/Icinga/Repository/RepositoryQuery.php
Expand Up @@ -43,7 +43,6 @@ class RepositoryQuery implements QueryInterface
public function __construct(Repository $repository)
{
$this->repository = $repository;
$this->query = $repository->getDataSource()->select();
}

/**
Expand All @@ -68,7 +67,10 @@ public function getQuery()
*/
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;
}
Expand Down

0 comments on commit d39c697

Please sign in to comment.