Permalink
Browse files

Moving some code around to extract useful bits out of query

  • Loading branch information...
lorenzo committed Feb 20, 2014
1 parent d66cb7b commit ce520a61eb2e850015cacf2563a18af1c48781ed
Showing with 5 additions and 5 deletions.
  1. +5 −5 src/ORM/Query.php
View
@@ -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);
+ }
}
/**
@@ -164,7 +168,6 @@ public function repository(Table $table = null) {
return $this->_table;
}
$this->_table = $table;
- $this->addDefaultTypes($table);
return $this;
}
@@ -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();
}
/**

0 comments on commit ce520a6

Please sign in to comment.