parent
4375c81d4d
commit
7a28b0c2f5
@ -0,0 +1,65 @@ |
||||
<?php |
||||
|
||||
namespace Chamilo\CoreBundle\Traits; |
||||
|
||||
use Doctrine\ORM\Mapping as ORM; |
||||
use Gedmo\Mapping\Annotation as Gedmo; |
||||
|
||||
trait TimestampableTypedEntity |
||||
{ |
||||
/** |
||||
* @Gedmo\Timestampable(on="create") |
||||
* @ORM\Column(type="datetime") |
||||
*/ |
||||
protected \DateTime $createdAt; |
||||
|
||||
/** |
||||
* @Gedmo\Timestampable(on="update") |
||||
* @ORM\Column(type="datetime") |
||||
*/ |
||||
protected \DateTime $updatedAt; |
||||
|
||||
/** |
||||
* Sets createdAt. |
||||
* |
||||
* @return $this |
||||
*/ |
||||
public function setCreatedAt(\DateTime $createdAt) |
||||
{ |
||||
$this->createdAt = $createdAt; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* Returns createdAt. |
||||
* |
||||
* @return \DateTime |
||||
*/ |
||||
public function getCreatedAt() |
||||
{ |
||||
return $this->createdAt; |
||||
} |
||||
|
||||
/** |
||||
* Sets updatedAt. |
||||
* |
||||
* @return $this |
||||
*/ |
||||
public function setUpdatedAt(\DateTime $updatedAt) |
||||
{ |
||||
$this->updatedAt = $updatedAt; |
||||
|
||||
return $this; |
||||
} |
||||
|
||||
/** |
||||
* Returns updatedAt. |
||||
* |
||||
* @return \DateTime |
||||
*/ |
||||
public function getUpdatedAt() |
||||
{ |
||||
return $this->updatedAt; |
||||
} |
||||
} |
Loading…
Reference in new issue