nineskeletor/src/Entity/Pagewidget.php

421 lines
8.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;
/**
* Pagewidget.
*
* @ORM\Entity
* @ORM\Table(name="pagewidget")
2023-02-01 09:03:27 +01:00
* @ORM\Entity(repositoryClass="App\Repository\PagewidgetRepository")
2023-01-10 11:13:28 +01:00
*/
class Pagewidget
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="name", type="string", length=100)
*/
private $name;
/**
* @var string
*
* @ORM\Column(name="loc", type="string")
*/
private $loc;
/**
* @var string
*
* @ORM\Column(name="roworder", type="integer")
*/
private $roworder;
/**
* @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="parameter", type="array", nullable=true)
*/
private $parameter;
/**
* @ORM\ManyToOne(targetEntity="Page", inversedBy="pagewidgets")
*/
private $page;
/**
* @ORM\ManyToOne(targetEntity="Widget", inversedBy="pagewidgets")
*/
private $widget;
/**
* @ORM\ManyToOne(targetEntity="Icon", inversedBy="pagewidgets")
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
*/
private $icon;
/**
* @var ArrayCollection
* @var Bookmark
*
* @ORM\OneToMany(targetEntity="Bookmark", mappedBy="pagewidget", cascade={"persist"}, orphanRemoval=true)
*/
private $bookmarks;
/**
* @var ArrayCollection
* @var Slide
*
2023-02-01 09:03:27 +01:00
* @ORM\OneToMany(targetEntity="Pagewidgetslide", mappedBy="pagewidget", cascade={"persist"}, orphanRemoval=true)
2023-01-10 11:13:28 +01:00
*/
2023-02-01 09:03:27 +01:00
private $pagewidgetslides;
2023-01-10 11:13:28 +01:00
2023-01-12 16:14:31 +01:00
public function __construct()
{
$this->bookmarks = new ArrayCollection();
2023-02-01 09:03:27 +01:00
$this->pagewidgetslides = new ArrayCollection();
2023-01-12 16:14:31 +01:00
}
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 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 getLoc(): ?string
2023-01-10 11:13:28 +01:00
{
2023-01-12 16:14:31 +01:00
return $this->loc;
2023-01-10 11:13:28 +01:00
}
2023-01-12 16:14:31 +01:00
public function setLoc(string $loc): self
2023-01-10 11:13:28 +01:00
{
$this->loc = $loc;
return $this;
}
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 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 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 getPage(): ?Page
2023-01-10 11:13:28 +01:00
{
return $this->page;
}
2023-01-12 16:14:31 +01:00
public function setPage(?Page $page): self
2023-01-10 11:13:28 +01:00
{
2023-01-12 16:14:31 +01:00
$this->page = $page;
2023-01-10 11:13:28 +01:00
return $this;
}
2023-01-12 16:14:31 +01:00
public function getWidget(): ?Widget
2023-01-10 11:13:28 +01:00
{
return $this->widget;
}
2023-01-12 16:14:31 +01:00
public function setWidget(?Widget $widget): self
2023-01-10 11:13:28 +01:00
{
2023-01-12 16:14:31 +01:00
$this->widget = $widget;
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, Bookmark>
2023-01-10 11:13:28 +01:00
*/
2023-01-12 16:14:31 +01:00
public function getBookmarks(): Collection
2023-01-10 11:13:28 +01:00
{
return $this->bookmarks;
}
2023-01-12 16:14:31 +01:00
public function addBookmark(Bookmark $bookmark): self
2023-01-10 11:13:28 +01:00
{
2023-01-12 16:14:31 +01:00
if (!$this->bookmarks->contains($bookmark)) {
$this->bookmarks->add($bookmark);
$bookmark->setPagewidget($this);
}
2023-01-10 11:13:28 +01:00
return $this;
}
2023-01-12 16:14:31 +01:00
public function removeBookmark(Bookmark $bookmark): self
2023-01-10 11:13:28 +01:00
{
2023-01-12 16:14:31 +01:00
if ($this->bookmarks->removeElement($bookmark)) {
// set the owning side to null (unless already changed)
if ($bookmark->getPagewidget() === $this) {
$bookmark->setPagewidget(null);
}
}
return $this;
2023-01-10 11:13:28 +01:00
}
/**
2023-02-01 09:03:27 +01:00
* @return Collection<int, Pagewidgetslide>
2023-01-10 11:13:28 +01:00
*/
2023-02-01 09:03:27 +01:00
public function getPagewidgetslides(): Collection
2023-01-10 11:13:28 +01:00
{
2023-02-01 09:03:27 +01:00
return $this->pagewidgetslides;
2023-01-10 11:13:28 +01:00
}
2023-02-01 09:03:27 +01:00
public function addPagewidgetslide(Pagewidgetslide $pagewidgetslide): self
2023-01-10 11:13:28 +01:00
{
2023-02-01 09:03:27 +01:00
if (!$this->pagewidgetslides->contains($pagewidgetslide)) {
$this->pagewidgetslides->add($pagewidgetslide);
$pagewidgetslide->setPagewidget($this);
2023-01-12 16:14:31 +01:00
}
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-02-01 09:03:27 +01:00
public function removePagewidgetslide(Pagewidgetslide $pagewidgetslide): self
2023-01-10 11:13:28 +01:00
{
2023-02-01 09:03:27 +01:00
if ($this->pagewidgetslides->removeElement($pagewidgetslide)) {
2023-01-12 16:14:31 +01:00
// set the owning side to null (unless already changed)
2023-02-01 09:03:27 +01:00
if ($pagewidgetslide->getPagewidget() === $this) {
$pagewidgetslide->setPagewidget(null);
2023-01-12 16:14:31 +01:00
}
}
return $this;
2023-01-10 11:13:28 +01:00
}
}