refactor: remove legacy methods
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -10,14 +10,12 @@ declare(strict_types=1);
|
|||||||
namespace KTXM\ProviderLocalChrono\Providers\Personal;
|
namespace KTXM\ProviderLocalChrono\Providers\Personal;
|
||||||
|
|
||||||
use KTXF\Chrono\Entity\EntityMutableAbstract;
|
use KTXF\Chrono\Entity\EntityMutableAbstract;
|
||||||
use KTXF\Chrono\Event\EventObject;
|
|
||||||
use KTXF\Utile\Timestamp;
|
use KTXF\Utile\Timestamp;
|
||||||
|
|
||||||
class EntityResource extends EntityMutableAbstract {
|
class EntityResource extends EntityMutableAbstract {
|
||||||
|
|
||||||
private ?string $tenantId = null;
|
private ?string $tenantId = null;
|
||||||
private ?string $userId = null;
|
private ?string $userId = null;
|
||||||
private ?EventObject $entityDataObject = null;
|
|
||||||
|
|
||||||
public function __construct(
|
public function __construct(
|
||||||
string $provider = 'default',
|
string $provider = 'default',
|
||||||
@@ -38,8 +36,7 @@ class EntityResource extends EntityMutableAbstract {
|
|||||||
$this->data[self::PROPERTY_CREATED] = $document['createdOn'] ?? null;
|
$this->data[self::PROPERTY_CREATED] = $document['createdOn'] ?? null;
|
||||||
$this->data[self::PROPERTY_MODIFIED] = $document['modifiedOn'] ?? null;
|
$this->data[self::PROPERTY_MODIFIED] = $document['modifiedOn'] ?? null;
|
||||||
$this->getProperties()->fromStore($document);
|
$this->getProperties()->fromStore($document);
|
||||||
$this->data[self::PROPERTY_SIGNATURE] = md5(json_encode($this->getDataJson()));
|
$this->data[self::PROPERTY_SIGNATURE] = md5(json_encode($this->getProperties()->getDataRaw()));
|
||||||
$this->entityDataObject = null;
|
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
@@ -67,28 +64,4 @@ class EntityResource extends EntityMutableAbstract {
|
|||||||
return $this->properties;
|
return $this->properties;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getDataObject(): EventObject|null {
|
|
||||||
return $this->entityDataObject;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setDataObject(EventObject $value): static
|
|
||||||
{
|
|
||||||
$this->entityDataObject = $value;
|
|
||||||
$this->setDataJson($value->jsonSerialize());
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getDataJson(): array|string|null {
|
|
||||||
return $this->getProperties()->getDataRaw();
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setDataJson(array|string|null $value): static
|
|
||||||
{
|
|
||||||
$this->entityDataObject = null;
|
|
||||||
$this->getProperties()->setDataRaw($value);
|
|
||||||
$this->data[self::PROPERTY_SIGNATURE] = md5(json_encode($value));
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user