Skip to content

Commit 9c69860

Browse files
committed
Use get_class instead of objType() to get the model class in CollectionLoader
1 parent fd7c1c7 commit 9c69860

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/Charcoal/Loader/CollectionLoader.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,6 @@ public function loadFromQuery($query, callable $callback = null, callable $befor
631631
*/
632632
protected function processCollection($results, callable $before = null, callable $after = null)
633633
{
634-
$modelObjType = $this->model()->objType();
635634
$collection = $this->createCollection();
636635
foreach ($results as $objData) {
637636
$obj = $this->processModel($objData, $before, $after);
@@ -657,7 +656,7 @@ protected function processModel($objData, callable $before = null, callable $aft
657656
if ($this->dynamicTypeField && isset($objData[$this->dynamicTypeField])) {
658657
$objType = $objData[$this->dynamicTypeField];
659658
} else {
660-
$objType = $this->model()->objType();
659+
$objType = get_class($this->model());
661660
}
662661

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

0 commit comments

Comments
 (0)