src/AtechNet/CoreBundle/Entity/AbstractSortableEntity.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\AtechNet\CoreBundle\Entity;
  3. use App\AtechNet\CoreBundle\Helper\SortableEntityInterface;
  4. use Doctrine\ORM\Mapping\Column;
  5. use Doctrine\ORM\Mapping\MappedSuperclass;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. /**
  8.  * Entity
  9.  *
  10.  * @MappedSuperclass
  11.  */
  12. abstract class AbstractSortableEntity extends AbstractEntity implements SortableEntityInterface
  13. {
  14.     /**
  15.      * @var integer
  16.      *
  17.      * @Assert\NotNull
  18.      *
  19.      * @Column(name="sort_index", type="integer")
  20.      */
  21.     private $sortIndex = -1;
  22.     /**
  23.      * @return int
  24.      */
  25.     public function getSortIndex()
  26.     {
  27.         return $this->sortIndex;
  28.     }
  29.     /**
  30.      * @param int $sortIndex
  31.      */
  32.     public function setSortIndex($sortIndex)
  33.     {
  34.         $this->sortIndex = $sortIndex;
  35.     }
  36. }