Skip to content

Commit

Permalink
Fix merge conflict issues and failing tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
markstory committed Dec 30, 2013
1 parent c7ef7f5 commit 2af4166
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
11 changes: 3 additions & 8 deletions Cake/ORM/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -651,13 +651,8 @@ public function first() {
$this->limit(1);
}
$this->bufferResults();
<<<<<<< HEAD
$this->_results = $this->execute();
return $this->_results->first();
=======
$this->_results = $this->all();
return $this->_results->one();
>>>>>>> Separate execute() into 2 methods.
return $this->_results->first();
}

/**
Expand Down Expand Up @@ -1025,8 +1020,8 @@ public function __call($method, $arguments) {
if ($this->type() === 'select') {
$resultSetClass = __NAMESPACE__ . '\ResultSetDecorator';
if (in_array($method, get_class_methods($resultSetClass))) {
$object = $this->execute();
return call_user_func_array([$object, $method], $arguments);
$results = $this->all();
return call_user_func_array([$results, $method], $arguments);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Cake/Test/TestCase/ORM/ResultSetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function testRewind() {
*/
public function testRewindStreaming() {
$query = $this->table->find('all')->bufferResults(false);
$results = $query->execute();
$results = $query->all();
$first = $second = [];
foreach ($results as $result) {
$first[] = $result;
Expand Down

0 comments on commit 2af4166

Please sign in to comment.