Source of file IsActiveEntity.php

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

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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
<?php

namespace NextDom\Model\Entity\Parents;

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

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

    /**
     * @return bool
     */
    public function getIsActive()
    {
        return $this->isActive;
    }

    /**
     * Get active state of the scenario
     *
     * @return bool Active state
     */
    public function isActive(): bool
    {
        return $this->isActive == 1;
    }

    /**
     *
     * @param int $isActive
     * @return $this
     */
    public function setIsActive($isActive)
    {
        if ($isActive != $this->getIsActive()) {
            $this->_changeState = true;
            $this->_changed = true;
        }
        $this->isActive = $isActive;
        return $this;
    }
}