refactor: use unified service provider desing

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-06-25 23:47:17 -04:00
parent 87d6af93b7
commit 6ca83a7dd7
19 changed files with 198 additions and 135 deletions
@@ -9,21 +9,25 @@ declare(strict_types=1);
namespace KTXF\Chrono\Entity;
use KTXF\Resource\Identifier\EntityIdentifier;
use KTXF\Resource\Provider\Node\NodeMutableAbstract;
use KTXF\Resource\Provider\Node\NodePropertiesMutableInterface;
/**
* Abstract Chrono Entity Mutable Class
*
*
* Provides common implementation for mutable chrono entities
*
*
* @since 2025.05.01
*/
abstract class EntityMutableAbstract extends NodeMutableAbstract implements EntityMutableInterface {
public const JSON_TYPE = EntityMutableInterface::JSON_TYPE;
protected string $type = 'chrono:entity';
protected EntityPropertiesMutableInterface $properties;
protected EntityPropertiesMutableAbstract $properties;
protected function nodeIdentifier(): EntityIdentifier {
return new EntityIdentifier($this->data[static::PROPERTY_PROVIDER], $this->data[static::PROPERTY_SERVICE], (string) $this->data[static::PROPERTY_COLLECTION], (string) $this->data[static::PROPERTY_IDENTIFIER]);
}
/**
* @inheritDoc
@@ -40,7 +44,7 @@ abstract class EntityMutableAbstract extends NodeMutableAbstract implements Enti
throw new \InvalidArgumentException('Properties must implement EntityPropertiesMutableInterface');
}
$this->properties->setDataRaw($value->getDataRaw());
$this->properties = $value;
return $this;
}