refactor: remove legacy methods
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -9,14 +9,13 @@ declare(strict_types=1);
|
||||
|
||||
namespace KTXM\ProviderLocalPeople\Providers\Personal;
|
||||
|
||||
use KTXF\Utile\Timestamp;
|
||||
use KTXF\People\Entity\EntityMutableAbstract;
|
||||
use KTXF\People\Entity\IndividualObject;
|
||||
|
||||
class EntityResource extends EntityMutableAbstract {
|
||||
|
||||
private ?string $tenantId = null;
|
||||
private ?string $userId = null;
|
||||
private ?IndividualObject $entityDataObject = null;
|
||||
|
||||
public function __construct(
|
||||
string $provider = 'default',
|
||||
@@ -37,8 +36,7 @@ class EntityResource extends EntityMutableAbstract {
|
||||
$this->data[self::PROPERTY_CREATED] = $document['createdOn'] ?? null;
|
||||
$this->data[self::PROPERTY_MODIFIED] = $document['modifiedOn'] ?? null;
|
||||
$this->getProperties()->fromStore($document);
|
||||
$this->data[self::PROPERTY_SIGNATURE] = md5(json_encode($this->getDataJson()));
|
||||
$this->entityDataObject = null;
|
||||
$this->data[self::PROPERTY_SIGNATURE] = md5(json_encode($this->getProperties()->getDataRaw()));
|
||||
|
||||
return $this;
|
||||
}
|
||||
@@ -66,28 +64,4 @@ class EntityResource extends EntityMutableAbstract {
|
||||
return $this->properties;
|
||||
}
|
||||
|
||||
public function getDataObject(): IndividualObject|null {
|
||||
return $this->entityDataObject;
|
||||
}
|
||||
|
||||
public function setDataObject(IndividualObject $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