Initial commit

This commit is contained in:
isUnknown 2025-10-03 07:46:23 +02:00
commit efa5624dab
687 changed files with 162710 additions and 0 deletions

View file

@ -0,0 +1,32 @@
<?php
namespace Kirby\Cms;
use Closure;
use Kirby\Toolkit\Collection as BaseCollection;
/**
* NestCollection
*
* @package Kirby Cms
* @author Bastian Allgeier <bastian@getkirby.com>
* @link https://getkirby.com
* @copyright Bastian Allgeier
* @license https://getkirby.com/license
*
* @extends \Kirby\Toolkit\Collection<\Kirby\Cms\NestObject|\Kirby\Content\Field>
*/
class NestCollection extends BaseCollection
{
/**
* Converts all objects in the collection
* to an array. This can also take a callback
* function to further modify the array result.
*/
public function toArray(Closure|null $map = null): array
{
return parent::toArray(
$map ?? fn ($object) => $object->toArray()
);
}
}