for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Obblm\Core\Entity\Traits;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\HasLifecycleCallbacks
*/
trait TimeStampableTrait
{
* @ORM\Column(type="datetime", nullable=true)
private $createdAt;
private $updatedAt;
public function getCreatedAt(): ?\DateTimeInterface
return $this->createdAt;
}
public function setCreatedAt(\DateTimeInterface $createdAt): self
$this->createdAt = $createdAt;
return $this;
public function getUpdatedAt(): ?\DateTimeInterface
return $this->updatedAt;
public function setUpdatedAt(\DateTimeInterface $updatedAt): self
$this->updatedAt = $updatedAt;
* @ORM\PrePersist
public function setCreatedAtValue()
$this->createdAt = new \DateTime();
* @ORM\PreUpdate
public function setUpdatedAtValue()
$this->updatedAt = new \DateTime();