Skip to content

Commit

Permalink
new instances of ORMWrapper must define _class_name for model
Browse files Browse the repository at this point in the history
  • Loading branch information
Surt committed Nov 8, 2013
1 parent 73a3388 commit d84f9f1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Granada/Orm/Wrapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use Granada\ORM;
use Granada\Eager;
use Exception;

/**
* Subclass of Idiorm's ORM class that supports
Expand Down Expand Up @@ -71,6 +72,7 @@ protected function _create_model_instance($orm) {
}
$model = new $this->_class_name();
$orm->resultSetClass = $model->get_resultSetClass();
$orm->set_class_name($this->_class_name);
$model->set_orm($orm);
return $model;
}
Expand Down Expand Up @@ -198,7 +200,7 @@ protected function _get_instances($rows){
*/
public function pluck($column)
{
$result = (array) $this->find_one();
$result = (array) $this->select($column)->find_one();

if(count($result) > 0) {
$row = reset($result);
Expand Down

0 comments on commit d84f9f1

Please # to comment.