nineskeletor/src/Entity/Widget.php

386 lines
7.3 KiB
PHP
Raw Normal View History

2023-01-10 11:13:28 +01:00
<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
2023-01-12 16:14:31 +01:00
use Doctrine\Common\Collections\Collection;
2023-01-10 11:13:28 +01:00
use Doctrine\ORM\Mapping as ORM;
/**
* Widget.
*
* @ORM\Entity
* @ORM\Table(name="widget")
* @ORM\Entity(repositoryClass="App\Repository\WidgetRepository")
*/
class Widget
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var int
*
* @ORM\Column(name="roworder", type="integer")
*/
private $roworder;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=100)
*/
private $name;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=true)
*/
private $description;
/**
* @var string
*
* @ORM\Column(name="routeview", type="string")
*/
private $routeview;
/**
* @var int
*
* @ORM\Column(name="height", type="integer")
*/
private $height;
/**
* @var bool
*
* @ORM\Column(name="autoajust", type="boolean", options={"default":false})
*/
protected $autoajust;
/**
* @var bool
*
* @ORM\Column(name="border", type="boolean", options={"default":true})
*/
protected $border;
/**
* @var bool
*
* @ORM\Column(name="opened", type="boolean", options={"default":true})
*/
protected $opened;
2023-01-12 16:14:31 +01:00
/**
* @var bool
*
* @ORM\Column(name="viewheader", type="boolean", options={"default":true})
*/
protected $viewheader;
2023-01-10 11:13:28 +01:00
/**
* @var string
*
* @ORM\Column(name="colorheaderback", type="string", nullable=true)
*/
protected $colorheaderback;
/**
* @var string
*
* @ORM\Column(name="colorheaderfont", type="string", nullable=true)
*/
protected $colorheaderfont;
/**
* @var string
*
* @ORM\Column(name="colorbodyback", type="string", nullable=true)
*/
protected $colorbodyback;
/**
* @var string
*
* @ORM\Column(name="colorbodyfont", type="string", nullable=true)
*/
protected $colorbodyfont;
/**
* @var string
*
* @ORM\Column(name="access", type="array", nullable=true)
*/
protected $access;
/**
* @var string
*
* @ORM\Column(name="parameter", type="array", nullable=true)
*/
private $parameter;
/**
* @ORM\ManyToOne(targetEntity="Icon", inversedBy="widgets")
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
*/
private $icon;
/**
* @var ArrayCollection
* @var Order
*
* @ORM\OneToMany(targetEntity="Pagewidget", mappedBy="widget", cascade={"persist"}, orphanRemoval=true)
*/
private $pagewidgets;
2023-01-12 16:14:31 +01:00
public function __construct()
{
$this->pagewidgets = new ArrayCollection();
}
2023-01-10 11:13:28 +01:00
// A garder pour forcer l'id en init
public function setId($id)
{
$this->id = $id;
return $this;
}
2023-01-12 16:14:31 +01:00
public function getId(): ?int
2023-01-10 11:13:28 +01:00
{
2023-01-12 16:14:31 +01:00
return $this->id;
2023-01-10 11:13:28 +01:00
}
2023-01-12 16:14:31 +01:00
public function getRoworder(): ?int
2023-01-10 11:13:28 +01:00
{
2023-01-12 16:14:31 +01:00
return $this->roworder;
2023-01-10 11:13:28 +01:00
}
2023-01-12 16:14:31 +01:00
public function setRoworder(int $roworder): self
2023-01-10 11:13:28 +01:00
{
$this->roworder = $roworder;
return $this;
}
2023-01-12 16:14:31 +01:00
public function getName(): ?string
2023-01-10 11:13:28 +01:00
{
2023-01-12 16:14:31 +01:00
return $this->name;
2023-01-10 11:13:28 +01:00
}
2023-01-12 16:14:31 +01:00
public function setName(string $name): self
2023-01-10 11:13:28 +01:00
{
$this->name = $name;
return $this;
}
2023-01-12 16:14:31 +01:00
public function getDescription(): ?string
2023-01-10 11:13:28 +01:00
{
2023-01-12 16:14:31 +01:00
return $this->description;
2023-01-10 11:13:28 +01:00
}
2023-01-12 16:14:31 +01:00
public function setDescription(?string $description): self
2023-01-10 11:13:28 +01:00
{
$this->description = $description;
return $this;
}
2023-01-12 16:14:31 +01:00
public function getRouteview(): ?string
2023-01-10 11:13:28 +01:00
{
2023-01-12 16:14:31 +01:00
return $this->routeview;
2023-01-10 11:13:28 +01:00
}
2023-01-12 16:14:31 +01:00
public function setRouteview(string $routeview): self
2023-01-10 11:13:28 +01:00
{
$this->routeview = $routeview;
return $this;
}
2023-01-12 16:14:31 +01:00
public function getHeight(): ?int
2023-01-10 11:13:28 +01:00
{
2023-01-12 16:14:31 +01:00
return $this->height;
2023-01-10 11:13:28 +01:00
}
2023-01-12 16:14:31 +01:00
public function setHeight(int $height): self
2023-01-10 11:13:28 +01:00
{
$this->height = $height;
return $this;
}
2023-01-12 16:14:31 +01:00
public function isAutoajust(): ?bool
2023-01-10 11:13:28 +01:00
{
2023-01-12 16:14:31 +01:00
return $this->autoajust;
2023-01-10 11:13:28 +01:00
}
2023-01-12 16:14:31 +01:00
public function setAutoajust(bool $autoajust): self
2023-01-10 11:13:28 +01:00
{
$this->autoajust = $autoajust;
return $this;
}
2023-01-12 16:14:31 +01:00
public function isBorder(): ?bool
2023-01-10 11:13:28 +01:00
{
2023-01-12 16:14:31 +01:00
return $this->border;
2023-01-10 11:13:28 +01:00
}
2023-01-12 16:14:31 +01:00
public function setBorder(bool $border): self
2023-01-10 11:13:28 +01:00
{
$this->border = $border;
return $this;
}
2023-01-12 16:14:31 +01:00
public function isOpened(): ?bool
2023-01-10 11:13:28 +01:00
{
2023-01-12 16:14:31 +01:00
return $this->opened;
2023-01-10 11:13:28 +01:00
}
2023-01-12 16:14:31 +01:00
public function setOpened(bool $opened): self
2023-01-10 11:13:28 +01:00
{
$this->opened = $opened;
return $this;
}
2023-01-12 16:14:31 +01:00
public function isViewheader(): ?bool
2023-01-10 11:13:28 +01:00
{
2023-01-12 16:14:31 +01:00
return $this->viewheader;
2023-01-10 11:13:28 +01:00
}
2023-01-12 16:14:31 +01:00
public function setViewheader(bool $viewheader): self
2023-01-10 11:13:28 +01:00
{
2023-01-12 16:14:31 +01:00
$this->viewheader = $viewheader;
2023-01-10 11:13:28 +01:00
return $this;
}
2023-01-12 16:14:31 +01:00
public function getColorheaderback(): ?string
2023-01-10 11:13:28 +01:00
{
return $this->colorheaderback;
}
2023-01-12 16:14:31 +01:00
public function setColorheaderback(?string $colorheaderback): self
2023-01-10 11:13:28 +01:00
{
2023-01-12 16:14:31 +01:00
$this->colorheaderback = $colorheaderback;
2023-01-10 11:13:28 +01:00
return $this;
}
2023-01-12 16:14:31 +01:00
public function getColorheaderfont(): ?string
2023-01-10 11:13:28 +01:00
{
return $this->colorheaderfont;
}
2023-01-12 16:14:31 +01:00
public function setColorheaderfont(?string $colorheaderfont): self
2023-01-10 11:13:28 +01:00
{
2023-01-12 16:14:31 +01:00
$this->colorheaderfont = $colorheaderfont;
2023-01-10 11:13:28 +01:00
return $this;
}
2023-01-12 16:14:31 +01:00
public function getColorbodyback(): ?string
2023-01-10 11:13:28 +01:00
{
return $this->colorbodyback;
}
2023-01-12 16:14:31 +01:00
public function setColorbodyback(?string $colorbodyback): self
2023-01-10 11:13:28 +01:00
{
2023-01-12 16:14:31 +01:00
$this->colorbodyback = $colorbodyback;
2023-01-10 11:13:28 +01:00
return $this;
}
2023-01-12 16:14:31 +01:00
public function getColorbodyfont(): ?string
2023-01-10 11:13:28 +01:00
{
return $this->colorbodyfont;
}
2023-01-12 16:14:31 +01:00
public function setColorbodyfont(?string $colorbodyfont): self
2023-01-10 11:13:28 +01:00
{
2023-01-12 16:14:31 +01:00
$this->colorbodyfont = $colorbodyfont;
2023-01-10 11:13:28 +01:00
return $this;
}
2023-01-12 16:14:31 +01:00
public function getAccess(): array
2023-01-10 11:13:28 +01:00
{
return $this->access;
}
2023-01-12 16:14:31 +01:00
public function setAccess(?array $access): self
2023-01-10 11:13:28 +01:00
{
2023-01-12 16:14:31 +01:00
$this->access = $access;
2023-01-10 11:13:28 +01:00
return $this;
}
2023-01-12 16:14:31 +01:00
public function getParameter(): array
2023-01-10 11:13:28 +01:00
{
return $this->parameter;
}
2023-01-12 16:14:31 +01:00
public function setParameter(?array $parameter): self
2023-01-10 11:13:28 +01:00
{
2023-01-12 16:14:31 +01:00
$this->parameter = $parameter;
2023-01-10 11:13:28 +01:00
return $this;
}
2023-01-12 16:14:31 +01:00
public function getIcon(): ?Icon
2023-01-10 11:13:28 +01:00
{
return $this->icon;
}
2023-01-12 16:14:31 +01:00
public function setIcon(?Icon $icon): self
2023-01-10 11:13:28 +01:00
{
2023-01-12 16:14:31 +01:00
$this->icon = $icon;
2023-01-10 11:13:28 +01:00
return $this;
}
/**
2023-01-12 16:14:31 +01:00
* @return Collection<int, Pagewidget>
2023-01-10 11:13:28 +01:00
*/
2023-01-12 16:14:31 +01:00
public function getPagewidgets(): Collection
2023-01-10 11:13:28 +01:00
{
return $this->pagewidgets;
}
2023-01-12 16:14:31 +01:00
public function addPagewidget(Pagewidget $pagewidget): self
2023-01-10 11:13:28 +01:00
{
2023-01-12 16:14:31 +01:00
if (!$this->pagewidgets->contains($pagewidget)) {
$this->pagewidgets->add($pagewidget);
$pagewidget->setWidget($this);
}
2023-01-10 11:13:28 +01:00
2023-01-12 16:14:31 +01:00
return $this;
2023-01-10 11:13:28 +01:00
}
2023-01-12 16:14:31 +01:00
public function removePagewidget(Pagewidget $pagewidget): self
2023-01-10 11:13:28 +01:00
{
2023-01-12 16:14:31 +01:00
if ($this->pagewidgets->removeElement($pagewidget)) {
// set the owning side to null (unless already changed)
if ($pagewidget->getWidget() === $this) {
$pagewidget->setWidget(null);
}
}
return $this;
2023-01-10 11:13:28 +01:00
}
}