Initial Version
This commit is contained in:
23
core/lib/Module/ModuleCollection.php
Normal file
23
core/lib/Module/ModuleCollection.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace KTXC\Module;
|
||||
|
||||
use JsonSerializable;
|
||||
use KTXF\Utile\Collection\CollectionAbstract;
|
||||
|
||||
class ModuleCollection extends CollectionAbstract implements JsonSerializable
|
||||
{
|
||||
public function __construct(array $items = [])
|
||||
{
|
||||
parent::__construct($items, ModuleObject::class, CollectionAbstract::TYPE_STRING);
|
||||
}
|
||||
|
||||
public function jsonSerialize(): array
|
||||
{
|
||||
$result = [];
|
||||
foreach ($this as $key => $item) {
|
||||
$result[$key] = $item;
|
||||
}
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user