src/AtechNet/CoreBundle/Entity/Dashboard.php line 18

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\Entity;
  6. use Doctrine\ORM\Mapping\HasLifecycleCallbacks;
  7. use Doctrine\ORM\Mapping\JoinColumn;
  8. use Doctrine\ORM\Mapping\ManyToOne;
  9. use Doctrine\ORM\Mapping\Table as Table;
  10. /**
  11.  * @Table(name="dashboard")
  12.  * @Entity(repositoryClass="App\AtechNet\CoreBundle\Repository\DashboardRepository")
  13.  * @HasLifecycleCallbacks
  14.  */
  15. class Dashboard extends AbstractEntity implements SortableEntityInterface
  16. {
  17.     public const TYPE_NONE = '';
  18.     public const TYPE_INTERNAL_NEWS = 'internal_news';
  19.     public const TYPE_DAILY_INFO = 'daily_info';
  20.     public const TYPE_SALES_GOAL = 'sales_goal';
  21.     public const TYPE_GALLERY = 'gallery';
  22.     public const TYPE_LINKS = 'links';
  23.     public const TYPE_CHANGE_LOG = 'change_log';
  24.     public const TYPE_INFO_LINE = 'info_line';
  25.     /**
  26.      * @return array
  27.      */
  28.     public static function getTypeChoices(): array
  29.     {
  30.         return [
  31.             self::TYPE_NONE => self::TYPE_NONE,
  32.             self::TYPE_INTERNAL_NEWS => self::TYPE_INTERNAL_NEWS,
  33.             self::TYPE_DAILY_INFO => self::TYPE_DAILY_INFO,
  34.             self::TYPE_SALES_GOAL => self::TYPE_SALES_GOAL,
  35.             self::TYPE_GALLERY => self::TYPE_GALLERY,
  36.             self::TYPE_LINKS => self::TYPE_LINKS,
  37.             self::TYPE_CHANGE_LOG => self::TYPE_CHANGE_LOG,
  38.             self::TYPE_INFO_LINE => self::TYPE_INFO_LINE,
  39.         ];
  40.     }
  41.     /**
  42.      * @ManyToOne(targetEntity="User", inversedBy="dashboardWidgets")
  43.      * @JoinColumn(name="user_id", referencedColumnName="id")
  44.      */
  45.     private $user;
  46.     /**
  47.      * @var string
  48.      *
  49.      * @Column(name="type", type="string", length=255)
  50.      */
  51.     private $type;
  52.     /**
  53.      * @var integer
  54.      *
  55.      * @Column(name="width", type="integer")
  56.      */
  57.     private $width;
  58.     /**
  59.      * @var integer
  60.      *
  61.      * @Column(name="height", type="integer")
  62.      */
  63.     private $height;
  64.     /**
  65.      * @var integer
  66.      *
  67.      * @Column(name="sort_index", type="integer")
  68.      */
  69.     private $sortIndex = -1;
  70.     /**
  71.      * Set user
  72.      *
  73.      * @param User $user
  74.      */
  75.     public function setUser($user)
  76.     {
  77.         $this->user = $user;
  78.     }
  79.     /**
  80.      * Get user
  81.      *
  82.      * @return User
  83.      */
  84.     public function getUser()
  85.     {
  86.         return $this->user;
  87.     }
  88.     /**
  89.      * Set type
  90.      *
  91.      * @param string $type
  92.      * @return Dashboard
  93.      */
  94.     public function setType($type)
  95.     {
  96.         $this->type = $type;
  97.         return $this;
  98.     }
  99.     /**
  100.      * Get type
  101.      *
  102.      * @return string
  103.      */
  104.     public function getType()
  105.     {
  106.         return $this->type;
  107.     }
  108.     /**
  109.      * Set width
  110.      *
  111.      * @param integer $width
  112.      * @return Dashboard
  113.      */
  114.     public function setWidth($width)
  115.     {
  116.         $this->width = $width;
  117.         return $this;
  118.     }
  119.     /**
  120.      * Get width
  121.      *
  122.      * @return integer
  123.      */
  124.     public function getWidth()
  125.     {
  126.         return $this->width;
  127.     }
  128.     /**
  129.      * Set height
  130.      *
  131.      * @param integer $height
  132.      * @return Dashboard
  133.      */
  134.     public function setHeight($height)
  135.     {
  136.         $this->height = $height;
  137.         return $this;
  138.     }
  139.     /**
  140.      * Get height
  141.      *
  142.      * @return integer
  143.      */
  144.     public function getHeight()
  145.     {
  146.         return $this->height;
  147.     }
  148.     /**
  149.      * @return int
  150.      */
  151.     public function getSortIndex()
  152.     {
  153.         return $this->sortIndex;
  154.     }
  155.     /**
  156.      * @param int $sortIndex
  157.      */
  158.     public function setSortIndex($sortIndex)
  159.     {
  160.         $this->sortIndex = $sortIndex;
  161.     }
  162. }