Source of file EnableEntity.php

Size: 0,791 Bytes - Last Modified: 2020-10-24T02:46:31+00:00

/home/travis/build/NextDom/nextdom-core/src/Model/Entity/Parents/EnableEntity.php

1234567891011121314151617181920212223242526272829303132333435363738394041424344
<?php

namespace NextDom\Model\Entity\Parents;

trait EnableEntity
{
    abstract public function updateChangeState($oldValue, $newValue);

    /**
     * @var integer
     *
     * @ORM\Column(name="enable", type="integer", nullable=true)
     */
    protected $enable = 1;

    /**
     * @return int
     */
    public function getEnable()
    {
        return $this->enable;
    }

    /**
     * @param $_enable
     * @return $this
     */
    public function setEnable($_enable)
    {
        $this->updateChangeState($this->enable, $_enable);
        $this->enable = $_enable;
        return $this;
    }

    /**
     * Get bool enabled state
     *
     * @return bool True is task is enabled
     */
    public function isEnabled()
    {
        return $this->enable == 1;
    }
}