Skip to content

Commit

Permalink
Moving some code around to extract useful bits out of query
Browse files Browse the repository at this point in the history
  • Loading branch information
lorenzo committed Feb 21, 2014
1 parent d66cb7b commit ce520a6
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/ORM/Query.php
Expand Up @@ -147,6 +147,10 @@ class Query extends DatabaseQuery {
public function __construct($connection, $table) {
$this->connection($connection);
$this->repository($table);

if ($this->_table) {
$this->addDefaultTypes($this->_table);
}
}

/**
Expand All @@ -164,7 +168,6 @@ public function repository(Table $table = null) {
return $this->_table;
}
$this->_table = $table;
$this->addDefaultTypes($table);
return $this;
}

Expand Down Expand Up @@ -471,10 +474,7 @@ public function cache($key, $config = 'default') {
* @return Iterator
*/
public function getIterator() {
if (empty($this->_iterator) || $this->_dirty) {
$this->_iterator = $this->all();
}
return $this->_iterator;
return $this->all();
}

/**
Expand Down

0 comments on commit ce520a6

Please sign in to comment.