<?phpnamespace App\Daikin\BaseBundle\Entity;use \DateTime;use Doctrine\ORM\Mapping as ORM;use Gedmo\Mapping\Annotation as Gedmo;use EHC\HTMLIdableBundle\Interfaces\HTMLIdableInterface;/** * @ORM\MappedSuperclass */abstract class AbstractLivingEntity extends AbstractActivatableEntity implements HTMLIdableInterface{ /** * @ORM\Id * @ORM\Column(type="integer", options={"unsigned"=true}) * @ORM\GeneratedValue(strategy="AUTO") */ protected $id; /** * @Gedmo\Timestampable(on="create") * @ORM\Column(name="createdAt", type="datetime") */ protected $createdAt; /** * @Gedmo\Timestampable(on="update") * @ORM\Column(name="updatedAt", type="integer", nullable=true) */ protected $updatedAt; public function __construct() { parent::__construct(); $this->active = true; $this->activated = time(); $this->deletestatus = 0; $this->createdAt = new DateTime; $this->updatedAt = $this->createdAt->format('U'); } /** * get id * * @return integer */ public function getId() { return $this->id; } /** * Set created_at * * @param \DateTime $createdAt * @return AbstractLivingEntity */ public function setCreatedAt(DateTime $createdAt) { $this->createdAt = $createdAt; return $this; } /** * Get created_at * * @return \DateTime */ public function getCreatedAt() { return $this->createdAt; } /** * Set updated_at * * @param integer $updatedAt * @return AbstractLivingEntity */ public function setUpdatedAt($updatedAt) { $this->updatedAt = (int)$updatedAt; return $this; } /** * Get updated_at * * @return integer */ public function getUpdatedAt() { return $this->updatedAt; }}