Source of file OrderEntity.php

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

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

12345678910111213141516171819202122232425262728293031323334353637
<?php

namespace NextDom\Model\Entity\Parents;

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

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

    /**
     * @return int
     */
    public function getOrder()
    {
        if (empty($this->order)) {
            return 0;
        }
        return $this->order;
    }

    /**
     * @param $_order
     * @return $this
     */
    public function setOrder($_order)
    {
        $this->updateChangeState($this->order, $_order);
        $this->order = $_order;
        return $this;
    }
}