diff --git a/Database/Base/AbstractCollection.php b/Database/Base/AbstractCollection.php index 0f29d4ae..116c86ef 100644 --- a/Database/Base/AbstractCollection.php +++ b/Database/Base/AbstractCollection.php @@ -110,8 +110,13 @@ abstract class AbstractCollection extends Component implements \IteratorAggregat if (!$this->offsetExists($offset)) { return NULL; } + + if ($this->_item[$offset] instanceof ActiveRecord) { + return $this->_item[$offset]; + } + /** @var ActiveRecord $model */ - return $this->_item[$offset]; + return $this->model::populate($this->_item[$offset]); } /**