Skip to content

Commit 7bf1b99

Browse files
committed
added comments
1 parent 5400397 commit 7bf1b99

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/Database/Eloquent/FMModel.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ public static function createFromRecord($record)
148148

149149
public static function createModelsFromRecordSet(BaseCollection $records): Collection
150150
{
151-
// return an empty collection if an empty collection was passed in.
151+
// return an empty Eloquent/Collection (or a collection of the specific model type) if an empty collection was
152+
// passed in.
152153
if ($records->count() === 0) {
153154
return (new static())->newCollection([]);
154155
}
@@ -158,6 +159,7 @@ public static function createModelsFromRecordSet(BaseCollection $records): Colle
158159
return static::createFromRecord($record);
159160
});
160161

162+
// return the filled Eloquent/Collection (or a collection of the specific model type if possible)
161163
return (new static())->newCollection($mappedRecords->all());
162164
}
163165

0 commit comments

Comments
 (0)