Commit 39b8a228 authored by Sebastian Castro's avatar Sebastian Castro

Import add createdAt/updatedAt

parent c2189701
......@@ -10,6 +10,8 @@ use Biopen\CoreBundle\Document\AbstractFile;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Context\ExecutionContextInterface;
use Gedmo\Mapping\Annotation as Gedmo;
abstract class ImportState
{
const Started = "started";
......@@ -135,6 +137,18 @@ class Import extends AbstractFile
*/
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() {
$this->logs = new \Doctrine\Common\Collections\ArrayCollection();;
......@@ -545,4 +559,26 @@ class Import extends AbstractFile
{
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