Skip to content

Commit

Permalink
Use get_class instead of objType() to get the model class in Collecti…
Browse files Browse the repository at this point in the history
…onLoader
  • Loading branch information
JoelAlphonso committed Jun 19, 2017
1 parent fd7c1c7 commit 9c69860
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/Charcoal/Loader/CollectionLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,6 @@ public function loadFromQuery($query, callable $callback = null, callable $befor
*/
protected function processCollection($results, callable $before = null, callable $after = null)
{
$modelObjType = $this->model()->objType();
$collection = $this->createCollection();
foreach ($results as $objData) {
$obj = $this->processModel($objData, $before, $after);
Expand All @@ -657,7 +656,7 @@ protected function processModel($objData, callable $before = null, callable $aft
if ($this->dynamicTypeField && isset($objData[$this->dynamicTypeField])) {
$objType = $objData[$this->dynamicTypeField];
} else {
$objType = $this->model()->objType();
$objType = get_class($this->model());
}

$obj = $this->factory()->create($objType);
Expand Down

0 comments on commit 9c69860

Please sign in to comment.