refactor: use epoch time stamp
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
@@ -11,6 +11,7 @@ namespace KTXM\ProviderLocalChrono\Providers\Personal;
|
|||||||
|
|
||||||
use KTXF\Chrono\Collection\CollectionMutableAbstract;
|
use KTXF\Chrono\Collection\CollectionMutableAbstract;
|
||||||
use KTXF\Resource\Identifier\CollectionIdentifier;
|
use KTXF\Resource\Identifier\CollectionIdentifier;
|
||||||
|
use KTXF\Utile\Timestamp;
|
||||||
|
|
||||||
class CollectionResource extends CollectionMutableAbstract {
|
class CollectionResource extends CollectionMutableAbstract {
|
||||||
|
|
||||||
@@ -73,8 +74,8 @@ class CollectionResource extends CollectionMutableAbstract {
|
|||||||
'rank' => $properties->getRank(),
|
'rank' => $properties->getRank(),
|
||||||
'visibility' => $properties->getVisibility(),
|
'visibility' => $properties->getVisibility(),
|
||||||
'color' => $properties->getColor(),
|
'color' => $properties->getColor(),
|
||||||
'createdOn' => $this->data[self::PROPERTY_CREATED] ?? null,
|
'createdOn' => Timestamp::normalize($this->data[self::PROPERTY_CREATED] ?? null),
|
||||||
'modifiedOn' => $this->data[self::PROPERTY_MODIFIED] ?? null,
|
'modifiedOn' => Timestamp::normalize($this->data[self::PROPERTY_MODIFIED] ?? null),
|
||||||
'signature' => $this->data[self::PROPERTY_SIGNATURE] ?? null,
|
'signature' => $this->data[self::PROPERTY_SIGNATURE] ?? null,
|
||||||
'enabled' => $this->collectionEnabled,
|
'enabled' => $this->collectionEnabled,
|
||||||
], static fn($value) => $value !== null);
|
], static fn($value) => $value !== null);
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ namespace KTXM\ProviderLocalChrono\Providers\Personal;
|
|||||||
|
|
||||||
use KTXF\Chrono\Entity\EntityMutableAbstract;
|
use KTXF\Chrono\Entity\EntityMutableAbstract;
|
||||||
use KTXF\Chrono\Event\EventObject;
|
use KTXF\Chrono\Event\EventObject;
|
||||||
|
use KTXF\Utile\Timestamp;
|
||||||
|
|
||||||
class EntityResource extends EntityMutableAbstract {
|
class EntityResource extends EntityMutableAbstract {
|
||||||
|
|
||||||
@@ -49,8 +50,8 @@ class EntityResource extends EntityMutableAbstract {
|
|||||||
'uid' => $this->userId,
|
'uid' => $this->userId,
|
||||||
'cid' => $this->collection(),
|
'cid' => $this->collection(),
|
||||||
'eid' => $this->identifier(),
|
'eid' => $this->identifier(),
|
||||||
'createdOn' => $this->data[self::PROPERTY_CREATED] ?? date('c'),
|
'createdOn' => Timestamp::normalize($this->data[self::PROPERTY_CREATED] ?? null),
|
||||||
'modifiedOn' => date('c'),
|
'modifiedOn' => Timestamp::normalize($this->data[self::PROPERTY_MODIFIED] ?? null),
|
||||||
], static fn($value) => $value !== null);
|
], static fn($value) => $value !== null);
|
||||||
|
|
||||||
$document = array_merge($document, $this->getProperties()->toStore());
|
$document = array_merge($document, $this->getProperties()->toStore());
|
||||||
|
|||||||
Reference in New Issue
Block a user