mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 13:24:25 +00:00
Update StoredObject
entity.
This commit is contained in:
parent
59fcd1e96b
commit
dcb92b1378
@ -7,7 +7,9 @@ namespace Chill\DocStoreBundle\Entity;
|
|||||||
use Doctrine\ORM\Mapping as ORM;
|
use Doctrine\ORM\Mapping as ORM;
|
||||||
use ChampsLibres\AsyncUploaderBundle\Model\AsyncFileInterface;
|
use ChampsLibres\AsyncUploaderBundle\Model\AsyncFileInterface;
|
||||||
use ChampsLibres\AsyncUploaderBundle\Validator\Constraints\AsyncFileExists;
|
use ChampsLibres\AsyncUploaderBundle\Validator\Constraints\AsyncFileExists;
|
||||||
|
use ChampsLibres\WopiLib\Contract\Entity\Document;
|
||||||
use DateTimeInterface;
|
use DateTimeInterface;
|
||||||
|
use Ramsey\Uuid\Uuid;
|
||||||
use Symfony\Component\Serializer\Annotation as Serializer;
|
use Symfony\Component\Serializer\Annotation as Serializer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -19,7 +21,7 @@ use Symfony\Component\Serializer\Annotation as Serializer;
|
|||||||
* message="The file is not stored properly"
|
* message="The file is not stored properly"
|
||||||
* )
|
* )
|
||||||
*/
|
*/
|
||||||
class StoredObject implements AsyncFileInterface
|
class StoredObject implements AsyncFileInterface, Document
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* @ORM\Id()
|
* @ORM\Id()
|
||||||
@ -47,6 +49,11 @@ class StoredObject implements AsyncFileInterface
|
|||||||
*/
|
*/
|
||||||
private array $iv = [];
|
private array $iv = [];
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @ORM\Column(type="uuid", unique=true)
|
||||||
|
*/
|
||||||
|
private Uuid $uuid;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ORM\Column(type="datetime", name="creation_date")
|
* @ORM\Column(type="datetime", name="creation_date")
|
||||||
* @Serializer\Groups({"read"})
|
* @Serializer\Groups({"read"})
|
||||||
@ -68,6 +75,7 @@ class StoredObject implements AsyncFileInterface
|
|||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->creationDate = new \DateTime();
|
$this->creationDate = new \DateTime();
|
||||||
|
$this->uuid = Uuid::uuid4();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getId()
|
public function getId()
|
||||||
@ -155,5 +163,13 @@ class StoredObject implements AsyncFileInterface
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getUuid(): Uuid
|
||||||
|
{
|
||||||
|
return $this->uuid;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getWopiDocId(): string
|
||||||
|
{
|
||||||
|
return (string) $this->uuid;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user