Import add createdAt/updatedAt

parent c2189701
...@@ -10,6 +10,8 @@ use Biopen\CoreBundle\Document\AbstractFile; ...@@ -10,6 +10,8 @@ use Biopen\CoreBundle\Document\AbstractFile;
use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Context\ExecutionContextInterface; use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Gedmo\Mapping\Annotation as Gedmo;
abstract class ImportState abstract class ImportState
{ {
const Started = "started"; const Started = "started";
...@@ -135,6 +137,18 @@ class Import extends AbstractFile ...@@ -135,6 +137,18 @@ class Import extends AbstractFile
*/ */
private $lastRefresh = null; private $lastRefresh = null;
/**
* @MongoDB\Field(type="date")
* @Gedmo\Timestampable(on="create")
*/
private $createdAt;
/**
* @MongoDB\Field(type="date")
* @Gedmo\Timestampable(on="update")
*/
private $updatedAt;
public function __construct() { public function __construct() {
$this->logs = new \Doctrine\Common\Collections\ArrayCollection();; $this->logs = new \Doctrine\Common\Collections\ArrayCollection();;
...@@ -545,4 +559,26 @@ class Import extends AbstractFile ...@@ -545,4 +559,26 @@ class Import extends AbstractFile
{ {
return $this->lastRefresh; return $this->lastRefresh;
} }
/**
* Set createdAt
*
* @param date $createdAt
* @return $this
*/
public function setCreatedAt($createdAt)
{
$this->createdAt = $createdAt;
return $this;
}
/**
* Get createdAt
*
* @return date $createdAt
*/
public function getCreatedAt()
{
return $this->createdAt;
}
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment