<?php
namespace App\AtechNet\CoreBundle\Entity;
use App\AtechNet\CoreBundle\Helper\SortableEntityInterface;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\HasLifecycleCallbacks;
use Doctrine\ORM\Mapping\JoinColumn;
use Doctrine\ORM\Mapping\ManyToOne;
use Doctrine\ORM\Mapping\Table as Table;
/**
* @Table(name="dashboard")
* @Entity(repositoryClass="App\AtechNet\CoreBundle\Repository\DashboardRepository")
* @HasLifecycleCallbacks
*/
class Dashboard extends AbstractEntity implements SortableEntityInterface
{
public const TYPE_NONE = '';
public const TYPE_INTERNAL_NEWS = 'internal_news';
public const TYPE_DAILY_INFO = 'daily_info';
public const TYPE_SALES_GOAL = 'sales_goal';
public const TYPE_GALLERY = 'gallery';
public const TYPE_LINKS = 'links';
public const TYPE_CHANGE_LOG = 'change_log';
public const TYPE_INFO_LINE = 'info_line';
/**
* @return array
*/
public static function getTypeChoices(): array
{
return [
self::TYPE_NONE => self::TYPE_NONE,
self::TYPE_INTERNAL_NEWS => self::TYPE_INTERNAL_NEWS,
self::TYPE_DAILY_INFO => self::TYPE_DAILY_INFO,
self::TYPE_SALES_GOAL => self::TYPE_SALES_GOAL,
self::TYPE_GALLERY => self::TYPE_GALLERY,
self::TYPE_LINKS => self::TYPE_LINKS,
self::TYPE_CHANGE_LOG => self::TYPE_CHANGE_LOG,
self::TYPE_INFO_LINE => self::TYPE_INFO_LINE,
];
}
/**
* @ManyToOne(targetEntity="User", inversedBy="dashboardWidgets")
* @JoinColumn(name="user_id", referencedColumnName="id")
*/
private $user;
/**
* @var string
*
* @Column(name="type", type="string", length=255)
*/
private $type;
/**
* @var integer
*
* @Column(name="width", type="integer")
*/
private $width;
/**
* @var integer
*
* @Column(name="height", type="integer")
*/
private $height;
/**
* @var integer
*
* @Column(name="sort_index", type="integer")
*/
private $sortIndex = -1;
/**
* Set user
*
* @param User $user
*/
public function setUser($user)
{
$this->user = $user;
}
/**
* Get user
*
* @return User
*/
public function getUser()
{
return $this->user;
}
/**
* Set type
*
* @param string $type
* @return Dashboard
*/
public function setType($type)
{
$this->type = $type;
return $this;
}
/**
* Get type
*
* @return string
*/
public function getType()
{
return $this->type;
}
/**
* Set width
*
* @param integer $width
* @return Dashboard
*/
public function setWidth($width)
{
$this->width = $width;
return $this;
}
/**
* Get width
*
* @return integer
*/
public function getWidth()
{
return $this->width;
}
/**
* Set height
*
* @param integer $height
* @return Dashboard
*/
public function setHeight($height)
{
$this->height = $height;
return $this;
}
/**
* Get height
*
* @return integer
*/
public function getHeight()
{
return $this->height;
}
/**
* @return int
*/
public function getSortIndex()
{
return $this->sortIndex;
}
/**
* @param int $sortIndex
*/
public function setSortIndex($sortIndex)
{
$this->sortIndex = $sortIndex;
}
}