Merge branch 'master' of https://git.mcnd.ca/mcndave/ulmus
This commit is contained in:
commit
47953a6165
17 files changed
+576
-261
No files matched your search
+6
-3
@@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in new issue
Block a user