<?php
namespace App\Daikin\BaseBundle\Entity;
use \DateTime;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* @ORM\MappedSuperclass
*/
abstract class AbstractBaseEntity extends AbstractDeleteableEntity
{
/**
* @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->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 AbstractBaseEntity
*/
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 AbstractBaseEntity
*/
public function setUpdatedAt($updatedAt)
{
$this->updatedAt = (int)$updatedAt;
return $this;
}
/**
* Get updated_at
*
* @return integer
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
}