* SPDX-License-Identifier: AGPL-3.0-or-later */ namespace KTXF\Documents\Collection; use KTXF\Resource\Identifier\CollectionIdentifier; use KTXF\Resource\Provider\Node\NodeMutableAbstract; use KTXF\Resource\Provider\Node\NodePropertiesMutableInterface; /** * Abstract Documents Collection Mutable Class * * Provides common implementation for mutable chrono collections * * @since 2025.05.01 */ abstract class CollectionMutableAbstract extends NodeMutableAbstract implements CollectionMutableInterface { protected CollectionPropertiesMutableAbstract $properties; protected function nodeIdentifier(): CollectionIdentifier { return new CollectionIdentifier($this->data[static::PROPERTY_PROVIDER], $this->data[static::PROPERTY_SERVICE], (string) $this->data[static::PROPERTY_IDENTIFIER]); } /** * @inheritDoc */ public function getProperties(): CollectionPropertiesMutableInterface { return $this->properties; } /** * @inheritDoc */ public function setProperties(NodePropertiesMutableInterface $value): static { if (!$value instanceof CollectionPropertiesMutableInterface) { throw new \InvalidArgumentException('Properties must implement CollectionPropertiesMutableInterface'); } // Copy all property values $this->properties->setLabel($value->getLabel()); return $this; } }