<?phpnamespace App\Daikin\BaseBundle\Entity;use Doctrine\ORM\Mapping as ORM;use JMS\Serializer\Annotation as Serializer;/** * @ORM\MappedSuperclass * @Serializer\ExclusionPolicy("all") */abstract class AbstractActivatableEntity extends AbstractDeleteableEntity{ /** @ORM\Column(type="boolean") */ protected $active; /** @ORM\Column(type="integer", nullable=true) */ protected $activated; public function __construct() { parent::__construct(); $this->active = false; } /** * Set active property * * @param boolean $active * @return AbstractActivatableEntity */ public function setActive($active) { $this->active = (bool)$active; return $this; } /** * Get active property * * @return boolean */ public function getActive() { return $this->active; } /** * is this entity active? * * @return boolean */ public function isActive() { return $this->active; } /** * Set activated property * * @param integer $activated * @return AbstractActivatableEntity */ public function setActivated($activated = null) { $this->activated = $activated; return $this; } /** * Get activated * * @return integer */ public function getActivated() { return $this->activated; } /** * may the entity be activated? * * @return boolean */ public function isActivateable() { return ( ! $this->isActive() ); } /** * may the entity be deactivated? * * @return boolean */ public function isDeactivateable() { return $this->isActive(); }}