Files
server/shared/lib/Chrono/Collection/CollectionMutableAbstract.php
Sebastian Krupinski 18f8f0e1d1
All checks were successful
JS Unit Tests / test (pull_request) Successful in 13s
Build Test / build (pull_request) Successful in 17s
PHP Unit Tests / test (pull_request) Successful in 48s
chore: standardize chrono provider
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
2026-02-17 03:09:38 -05:00

51 lines
1.4 KiB
PHP

<?php
declare(strict_types=1);
/**
* SPDX-FileCopyrightText: Sebastian Krupinski <krupinski01@gmail.com>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace KTXF\Chrono\Collection;
use KTXF\Resource\Provider\Node\NodeMutableAbstract;
use KTXF\Resource\Provider\Node\NodePropertiesMutableInterface;
/**
* Abstract Chrono Collection Mutable Class
*
* Provides common implementation for mutable chrono collections
*
* @since 2025.05.01
*/
abstract class CollectionMutableAbstract extends NodeMutableAbstract implements CollectionMutableInterface {
protected CollectionPropertiesMutableAbstract $properties;
/**
* @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());
$this->properties->setDescription($value->getDescription());
$this->properties->setPriority($value->getPriority());
$this->properties->setVisibility($value->getVisibility());
$this->properties->setColor($value->getColor());
return $this;
}
}