2022-12-19 14:56:05 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Kirby\Uuid;
|
|
|
|
|
|
|
|
use Kirby\Cms\Structure;
|
2025-04-21 18:57:21 +02:00
|
|
|
use Kirby\Content\Field;
|
2022-12-19 14:56:05 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* UUID for \Kirby\Cms\StructureObject
|
|
|
|
*
|
|
|
|
* Not yet supported
|
|
|
|
* @todo Finish for uuid-block-structure-support
|
|
|
|
* @codeCoverageIgnore
|
|
|
|
*
|
|
|
|
* @package Kirby Uuid
|
|
|
|
* @author Nico Hoffmann <nico@getkirby.com>
|
|
|
|
* @link https://getkirby.com
|
|
|
|
* @copyright Bastian Allgeier
|
|
|
|
* @license https://getkirby.com/license
|
|
|
|
*/
|
|
|
|
class StructureUuid extends FieldUuid
|
|
|
|
{
|
|
|
|
protected const TYPE = 'struct';
|
|
|
|
protected const FIELD = 'structure';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @var \Kirby\Cms\StructureObject|null
|
|
|
|
*/
|
2025-04-21 18:57:21 +02:00
|
|
|
public Identifiable|null $model = null;
|
2022-12-19 14:56:05 +01:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Converts content field to a Structure collection
|
|
|
|
* @internal
|
|
|
|
*/
|
|
|
|
public static function fieldToCollection(Field $field): Structure
|
|
|
|
{
|
|
|
|
return $field->toStructure();
|
|
|
|
}
|
|
|
|
}
|