mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
refactor: Update ChillDocStoreBundle - Add StoredObject repository.
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\DocStoreBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
@@ -9,10 +9,10 @@ use ChampsLibres\AsyncUploaderBundle\Model\AsyncFileInterface;
|
||||
use ChampsLibres\AsyncUploaderBundle\Validator\Constraints\AsyncFileExists;
|
||||
|
||||
/**
|
||||
* Represent a document stored in an object store
|
||||
* Represent a document stored in an object store
|
||||
*
|
||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||
*
|
||||
*
|
||||
* @ORM\Entity()
|
||||
* @ORM\Table("chill_doc.stored_object")
|
||||
* @AsyncFileExists(
|
||||
@@ -27,51 +27,49 @@ class StoredObject implements AsyncFileInterface
|
||||
* @ORM\Column(type="integer")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="text")
|
||||
*/
|
||||
private $filename;
|
||||
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="json_array", name="key")
|
||||
* @var array
|
||||
*/
|
||||
private $keyInfos = array();
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @var int[]
|
||||
* @var int[]
|
||||
* @ORM\Column(type="json_array", name="iv")
|
||||
*/
|
||||
private $iv = array();
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @var \DateTime
|
||||
* @ORM\Column(type="datetime", name="creation_date")
|
||||
*/
|
||||
private $creationDate;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
* @ORM\Column(type="text", name="type")
|
||||
*/
|
||||
private $type = '';
|
||||
|
||||
private string $type = '';
|
||||
|
||||
/**
|
||||
*
|
||||
* @var array
|
||||
* @ORM\Column(type="json_array", name="datas")
|
||||
*/
|
||||
private $datas = [];
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->creationDate = new \DateTime();
|
||||
}
|
||||
|
||||
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
@@ -100,35 +98,39 @@ class StoredObject implements AsyncFileInterface
|
||||
public function setFilename($filename)
|
||||
{
|
||||
$this->filename = $filename;
|
||||
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setCreationDate(\DateTime $creationDate)
|
||||
{
|
||||
$this->creationDate = $creationDate;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setDatas(array $datas)
|
||||
{
|
||||
$this->datas = $datas;
|
||||
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated Use method "getFilename()".
|
||||
*/
|
||||
public function getObjectName()
|
||||
{
|
||||
return $this->getFilename();
|
||||
}
|
||||
|
||||
|
||||
public function getKeyInfos()
|
||||
{
|
||||
return $this->keyInfos;
|
||||
@@ -142,14 +144,14 @@ class StoredObject implements AsyncFileInterface
|
||||
public function setKeyInfos($keyInfos)
|
||||
{
|
||||
$this->keyInfos = $keyInfos;
|
||||
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setIv($iv)
|
||||
{
|
||||
$this->iv = $iv;
|
||||
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user