This commit is contained in:
Dave Mc Nicoll committed 2020-10-06 11:39:01 -04:00
commit 47953a6165
17 files changed
+576 -261

No files matched your search

+6 -3
View File
@@ -325,9 +325,9 @@ trait EntityTrait {
/**
* @Ignore
*/
public function toCollection() : array
public function toCollection() : EntityCollection
{
return new EntityCollection($this->toArray());
return static::entityCollection([ $this->toArray() ]);
}
/**
@@ -381,7 +381,10 @@ trait EntityTrait {
*/
public static function entityCollection(...$arguments) : EntityCollection
{
return new EntityCollection(...$arguments);
$collection = new EntityCollection(...$arguments);
$collection->entityClass = static::class;
return $collection;
}
/**