refactor: chrono entity classes

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-07-17 15:43:23 -04:00
parent 7e81e130c9
commit 28bc360106
14 changed files with 99 additions and 61 deletions
@@ -9,14 +9,28 @@ declare(strict_types=1);
namespace KTXF\Chrono\Entity;
use KTXF\Resource\Provider\Node\NodePropertiesBaseAbstract;
use KTXF\Json\JsonSerializableObject;
abstract class EntityPropertiesBaseAbstract extends NodePropertiesBaseAbstract implements EntityPropertiesBaseInterface {
/**
* Common base of the typed chrono entity objects ({@see EventObject},
* {@see TaskObject}, {@see JournalObject}).
*
* Gives providers a single class to build or extend entity properties
* against without involving the entity node wrapper, and one home for the
* shared behavior: the type/schema markers and the JSON serialization /
* deserialization machinery inherited from JsonSerializableObject.
*/
abstract class EntityPropertiesBaseAbstract extends JsonSerializableObject implements EntityPropertiesBaseInterface {
public string $type = 'event';
public int $schema = 1;
public function type(): string {
return $this->type;
}
public function schema(): int {
return $this->schema;
}
/**
* @inheritDoc
*/
public function getDataRaw(): array|string|null {
return $this->data[self::PROPERTY_DATA] ?? null;
}
}