v0 ninegate
Some checks failed
Cadoles/nineskeletor/pipeline/head There was a failure building this commit

This commit is contained in:
2023-01-10 11:13:28 +01:00
parent cedd6bfcec
commit 88cfeae266
273 changed files with 7828 additions and 16 deletions

413
src/Entity/Alert.php Executable file
View File

@@ -0,0 +1,413 @@
<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="alert")
* @ORM\Entity(repositoryClass="App\Repository\AlertRepository")
*/
class Alert
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="title", type="string", length=100)
*/
private $title;
/**
* @var string
*
* @ORM\Column(name="content", type="text", nullable=true)
*/
private $content;
/**
* @var int
*
* @ORM\Column(name="rowOrder", type="integer", nullable=true)
*/
private $rowOrder;
/**
* @var datetime
*
* @ORM\Column(name="publishedat", type="date")
*/
protected $publishedat;
/**
* @var datetime
*
* @ORM\Column(name="unpublishedat", type="date", nullable=true)
*/
protected $unpublishedat;
/**
* @ORM\Column(name="fghideable", type="boolean")
*/
private $fghideable;
/**
* @var string
*
* @ORM\Column(name="roles", type="array", nullable=true)
*/
private $roles;
/**
* @ORM\ManyToOne(targetEntity="Alertcategory", inversedBy="alerts")
* @ORM\JoinColumn(name="category", referencedColumnName="id", nullable=false, onDelete="CASCADE")
*/
protected $alertcategory;
/**
* @ORM\ManyToMany(targetEntity="Group", inversedBy="alerts", cascade={"persist"})
* @ORM\JoinTable(name="alertgroupe",
* joinColumns={@ORM\JoinColumn(name="alert", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="groupe", referencedColumnName="id")}
* )
*/
protected $groups;
/**
* @ORM\ManyToMany(targetEntity="User", inversedBy="alertreaders", cascade={"persist"})
* @ORM\JoinTable(name="alertuserread",
* joinColumns={@ORM\JoinColumn(name="alert", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="user", referencedColumnName="id")}
* )
*/
protected $readers;
// Is Online
public function isOnline()
{
$today = new \DateTime();
if (null === $this->unpublishedat &&
$this->publishedat->getTimestamp() <= $today->getTimestamp()
) {
return true;
}
if (
$this->publishedat->getTimestamp() <= $today->getTimestamp() &&
$this->unpublishedat->getTimestamp() >= $today->getTimestamp()
) {
return true;
}
return false;
}
// IsPending
public function isPending()
{
$today = new \DateTime();
if ($this->publishedat->getTimestamp() > $today->getTimestamp()) {
return true;
}
return false;
}
// IsArchived
public function isArchived()
{
$today = new \DateTime();
if (null === $this->unpublishedat) {
return false;
}
if ($this->unpublishedat->getTimestamp() < $today->getTimestamp()) {
return true;
}
return false;
}
/**
* Constructor.
*/
public function __construct()
{
$this->groups = new \Doctrine\Common\Collections\ArrayCollection();
$this->readers = new ArrayCollection();
}
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set title.
*
* @param string $title
*
* @return Alert
*/
public function setTitle($title)
{
$this->title = $title;
return $this;
}
/**
* Get title.
*
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* Set content.
*
* @param string $content
*
* @return Alert
*/
public function setContent($content)
{
$this->content = $content;
return $this;
}
/**
* Get content.
*
* @return string
*/
public function getContent()
{
return $this->content;
}
/**
* Set rowOrder.
*
* @param int $rowOrder
*
* @return Alert
*/
public function setRowOrder($rowOrder)
{
$this->rowOrder = $rowOrder;
return $this;
}
/**
* Get rowOrder.
*
* @return int
*/
public function getRowOrder()
{
return $this->rowOrder;
}
/**
* Set publishedat.
*
* @param \DateTime $publishedat
*
* @return Alert
*/
public function setpublishedat($publishedat)
{
$this->publishedat = $publishedat;
return $this;
}
/**
* Get publishedat.
*
* @return \DateTime
*/
public function getpublishedat()
{
return $this->publishedat;
}
/**
* Set unpublishedat.
*
* @param \DateTime $unpublishedat
*
* @return Alert
*/
public function setUnpublishedat($unpublishedat)
{
$this->unpublishedat = $unpublishedat;
return $this;
}
/**
* Get unpublishedat.
*
* @return \DateTime
*/
public function getUnpublishedat()
{
return $this->unpublishedat;
}
/**
* Set roles.
*
* @param array $roles
*
* @return Alert
*/
public function setRoles($roles)
{
$this->roles = $roles;
return $this;
}
/**
* Get roles.
*
* @return array
*/
public function getRoles()
{
return $this->roles;
}
/**
* Set alertcategory.
*
* @return Alert
*/
public function setAlertcategory(Alertcategory $alertcategory)
{
$this->alertcategory = $alertcategory;
return $this;
}
/**
* Get alertcategory.
*
* @return Alertcategory
*/
public function getAlertcategory()
{
return $this->alertcategory;
}
/**
* Add group.
*
* @return Alert
*/
public function addGroup(Group $group)
{
$this->groups[] = $group;
return $this;
}
/**
* Remove group.
*/
public function removeGroup(Group $group)
{
$this->groups->removeElement($group);
}
/**
* Get groups.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getGroups()
{
return $this->groups;
}
/**
* Set fghideable.
*
* @param bool $fghideable
*
* @return Alert
*/
public function setFghideable($fghideable)
{
$this->fghideable = $fghideable;
return $this;
}
/**
* Get fghideable.
*
* @return bool
*/
public function getFghideable()
{
return $this->fghideable;
}
/**
* Add reader.
*
* @return Alert
*/
public function addReader(User $reader)
{
$this->readers[] = $reader;
return $this;
}
/**
* Remove reader.
*/
public function removeReader(User $reader)
{
$this->readers->removeElement($reader);
}
/**
* Get readers.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getReaders()
{
return $this->readers;
}
public function isFghideable(): ?bool
{
return $this->fghideable;
}
}

175
src/Entity/Alertcategory.php Executable file
View File

@@ -0,0 +1,175 @@
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="alertcategory")
*/
class Alertcategory
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="label", type="string", length=100)
*/
private $label;
/**
* @var int
*
* @ORM\Column(name="color", type="string", nullable=true)
*/
private $color;
/**
* @ORM\ManyToOne(targetEntity="Icon", inversedBy="alertcategorys")
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
*/
private $icon;
/**
* @ORM\OneToMany(targetEntity="Alert", mappedBy="alertcategory", cascade={"persist"}, orphanRemoval=true)
* @ORM\JoinColumn(name="alerts", referencedColumnName="id")
*/
protected $alerts;
// A garder pour forcer l'id en init
public function setId($id)
{
$this->id = $id;
return $this;
}
/**
* Constructor.
*/
public function __construct()
{
$this->alerts = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set label.
*
* @param string $label
*
* @return Alertcategory
*/
public function setLabel($label)
{
$this->label = $label;
return $this;
}
/**
* Get label.
*
* @return string
*/
public function getLabel()
{
return $this->label;
}
/**
* Set color.
*
* @param string $color
*
* @return Alertcategory
*/
public function setColor($color)
{
$this->color = $color;
return $this;
}
/**
* Get color.
*
* @return string
*/
public function getColor()
{
return $this->color;
}
/**
* Set icon.
*
* @param Icon $icon
*
* @return Alertcategory
*/
public function setIcon(Icon $icon = null)
{
$this->icon = $icon;
return $this;
}
/**
* Get icon.
*
* @return Icon
*/
public function getIcon()
{
return $this->icon;
}
/**
* Add alert.
*
* @return Alertcategory
*/
public function addAlert(Alert $alert)
{
$this->alerts[] = $alert;
return $this;
}
/**
* Remove alert.
*/
public function removeAlert(Alert $alert)
{
$this->alerts->removeElement($alert);
}
/**
* Get alerts.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getAlerts()
{
return $this->alerts;
}
}

337
src/Entity/Bookmark.php Executable file
View File

@@ -0,0 +1,337 @@
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="bookmark")
*/
class Bookmark
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="title", type="string", length=100)
*/
private $title;
/**
* @var string
*
* @ORM\Column(name="subtitle", type="string", length=250, nullable=true)
*/
private $subtitle;
/**
* @var string
*
* @ORM\Column(name="url", type="string", length=500)
*/
private $url;
/**
* @var string
*
* @ORM\Column(name="target", type="string", length=32)
*/
private $target;
/**
* @var int
*
* @ORM\Column(name="rowOrder", type="integer", nullable=true)
*/
private $rowOrder;
/**
* @var string
*
* @ORM\Column(name="color", type="string", length=24, nullable=true)
*/
private $color;
/**
* @ORM\ManyToOne(targetEntity="Icon", inversedBy="bookmarks")
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
*/
private $icon;
/**
* @ORM\ManyToOne(targetEntity="User", inversedBy="bookmarks")
* @ORM\JoinColumn(nullable=true)
*/
private $user;
/**
* @ORM\ManyToOne(targetEntity="Pagewidget", inversedBy="bookmarks")
* @ORM\JoinColumn(nullable=true)
*/
private $pagewidget;
/**
* @ORM\ManyToOne(targetEntity="Item", inversedBy="bookmarks")
* @ORM\JoinColumn(nullable=true)
*/
private $item;
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set title.
*
* @param string $title
*
* @return Bookmark
*/
public function setTitle($title)
{
$this->title = $title;
return $this;
}
/**
* Get title.
*
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* Set subtitle.
*
* @param string $subtitle
*
* @return Bookmark
*/
public function setSubtitle($subtitle)
{
$this->subtitle = $subtitle;
return $this;
}
/**
* Get subtitle.
*
* @return string
*/
public function getSubtitle()
{
return $this->subtitle;
}
/**
* Set url.
*
* @param string $url
*
* @return Bookmark
*/
public function setUrl($url)
{
$this->url = $url;
return $this;
}
/**
* Get url.
*
* @return string
*/
public function getUrl()
{
return $this->url;
}
/**
* Set target.
*
* @param string $target
*
* @return Bookmark
*/
public function setTarget($target)
{
$this->target = $target;
return $this;
}
/**
* Get target.
*
* @return string
*/
public function getTarget()
{
return $this->target;
}
/**
* Set rowOrder.
*
* @param int $rowOrder
*
* @return Bookmark
*/
public function setRowOrder($rowOrder)
{
$this->rowOrder = $rowOrder;
return $this;
}
/**
* Get rowOrder.
*
* @return int
*/
public function getRowOrder()
{
return $this->rowOrder;
}
/**
* Set color.
*
* @param string $color
*
* @return Bookmark
*/
public function setColor($color)
{
$this->color = $color;
return $this;
}
/**
* Get color.
*
* @return string
*/
public function getColor()
{
return $this->color;
}
/**
* Set icon.
*
* @param Icon $icon
*
* @return Bookmark
*/
public function setIcon(Icon $icon = null)
{
$this->icon = $icon;
return $this;
}
/**
* Get icon.
*
* @return Icon
*/
public function getIcon()
{
return $this->icon;
}
/**
* Set user.
*
* @param User $user
*
* @return Bookmark
*/
public function setUser(User $user = null)
{
$this->user = $user;
return $this;
}
/**
* Get user.
*
* @return User
*/
public function getUser()
{
return $this->user;
}
/**
* Set pagewidget.
*
* @param Pagewidget $pagewidget
*
* @return Bookmark
*/
public function setPagewidget(Pagewidget $pagewidget = null)
{
$this->pagewidget = $pagewidget;
return $this;
}
/**
* Get pagewidget.
*
* @return Pagewidget
*/
public function getPagewidget()
{
return $this->pagewidget;
}
/**
* Set item.
*
* @param Item $item
*
* @return Bookmark
*/
public function setItem(Item $item = null)
{
$this->item = $item;
return $this;
}
/**
* Get item.
*
* @return Item
*/
public function getItem()
{
return $this->item;
}
}

View File

@@ -88,9 +88,21 @@ class Group
*/
private $users;
/**
* @ORM\ManyToMany(targetEntity="Alert", mappedBy="groups")
*/
protected $alerts;
/**
* @ORM\ManyToMany(targetEntity="Item", mappedBy="groups")
*/
protected $items;
public function __construct()
{
$this->users = new ArrayCollection();
$this->alerts = new ArrayCollection();
$this->items = new ArrayCollection();
}
// == CODE A NE PAS REGENERER
@@ -256,4 +268,58 @@ class Group
return $this;
}
/**
* @return Collection<int, Alert>
*/
public function getAlerts(): Collection
{
return $this->alerts;
}
public function addAlert(Alert $alert): self
{
if (!$this->alerts->contains($alert)) {
$this->alerts->add($alert);
$alert->addGroup($this);
}
return $this;
}
public function removeAlert(Alert $alert): self
{
if ($this->alerts->removeElement($alert)) {
$alert->removeGroup($this);
}
return $this;
}
/**
* @return Collection<int, Item>
*/
public function getItems(): Collection
{
return $this->items;
}
public function addItem(Item $item): self
{
if (!$this->items->contains($item)) {
$this->items->add($item);
$item->addGroup($this);
}
return $this;
}
public function removeItem(Item $item): self
{
if ($this->items->removeElement($item)) {
$item->removeGroup($this);
}
return $this;
}
}

400
src/Entity/Icon.php Executable file
View File

@@ -0,0 +1,400 @@
<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* @ORM\Entity
* @ORM\Table(name="icon")
* @UniqueEntity(fields="label", message="Une Icône existe déjà avec ce label")
*/
class Icon
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", length=250, unique=true)
*/
private $label;
/**
* @ORM\Column(type="string", length=250, nullable=true)
*/
private $tags;
/**
* @ORM\ManyToOne(targetEntity="User", inversedBy="icons")
* @ORM\JoinColumn(nullable=true)
*/
private $user;
/**
* @var ArrayCollection
* @var Item
*
* @ORM\OneToMany(targetEntity="Item", mappedBy="icon", cascade={"persist"}, orphanRemoval=false)
*/
private $items;
/**
* @var ArrayCollection
* @var Itemcategory
*
* @ORM\OneToMany(targetEntity="Itemcategory", mappedBy="icon", cascade={"persist"}, orphanRemoval=false)
*/
private $itemcategorys;
/**
* @var ArrayCollection
* @var Alertcategory
*
* @ORM\OneToMany(targetEntity="Alertcategory", mappedBy="icon", cascade={"persist"}, orphanRemoval=false)
*/
private $alertcategorys;
/**
* @var ArrayCollection
* @var Pagewidget
*
* @ORM\OneToMany(targetEntity="Pagewidget", mappedBy="icon", cascade={"persist"}, orphanRemoval=false)
*/
private $pagewidgets;
/**
* @var ArrayCollection
* @var Widget
*
* @ORM\OneToMany(targetEntity="Widget", mappedBy="icon", cascade={"persist"}, orphanRemoval=false)
*/
private $widgets;
/**
* @var ArrayCollection
* @var Bookmark
*
* @ORM\OneToMany(targetEntity="Bookmark", mappedBy="icon", cascade={"persist"}, orphanRemoval=false)
*/
private $bookmarks;
/**
* @var ArrayCollection
* @var Group
*
* @ORM\OneToMany(targetEntity="Group", mappedBy="icon", cascade={"persist"}, orphanRemoval=false)
*/
private $groups;
/**
* Constructor.
*/
public function __construct()
{
$this->items = new \Doctrine\Common\Collections\ArrayCollection();
$this->itemcategorys = new \Doctrine\Common\Collections\ArrayCollection();
$this->alertcategorys = new \Doctrine\Common\Collections\ArrayCollection();
$this->pagewidgets = new \Doctrine\Common\Collections\ArrayCollection();
$this->widgets = new \Doctrine\Common\Collections\ArrayCollection();
$this->bookmarks = new \Doctrine\Common\Collections\ArrayCollection();
$this->groups = new ArrayCollection();
}
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set label.
*
* @param string $label
*
* @return Icon
*/
public function setLabel($label)
{
$this->label = $label;
return $this;
}
/**
* Get label.
*
* @return string
*/
public function getLabel()
{
return $this->label;
}
/**
* Set user.
*
* @param User $user
*
* @return Icon
*/
public function setUser(User $user = null)
{
$this->user = $user;
return $this;
}
/**
* Get user.
*
* @return User
*/
public function getUser()
{
return $this->user;
}
/**
* Add item.
*
* @return Icon
*/
public function addItem(Item $item)
{
$this->items[] = $item;
return $this;
}
/**
* Remove item.
*/
public function removeItem(Item $item)
{
$this->items->removeElement($item);
}
/**
* Get items.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getItems()
{
return $this->items;
}
/**
* Add itemcategory.
*
* @return Icon
*/
public function addItemcategory(Itemcategory $itemcategory)
{
$this->itemcategorys[] = $itemcategory;
return $this;
}
/**
* Remove itemcategory.
*/
public function removeItemcategory(Itemcategory $itemcategory)
{
$this->itemcategorys->removeElement($itemcategory);
}
/**
* Get itemcategorys.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getItemcategorys()
{
return $this->itemcategorys;
}
/**
* Add alertcategory.
*
* @return Icon
*/
public function addAlertcategory(Alertcategory $alertcategory)
{
$this->alertcategorys[] = $alertcategory;
return $this;
}
/**
* Remove alertcategory.
*/
public function removeAlertcategory(Alertcategory $alertcategory)
{
$this->alertcategorys->removeElement($alertcategory);
}
/**
* Get alertcategorys.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getAlertcategorys()
{
return $this->alertcategorys;
}
/**
* Add pagewidget.
*
* @return Icon
*/
public function addPagewidget(Pagewidget $pagewidget)
{
$this->pagewidgets[] = $pagewidget;
return $this;
}
/**
* Remove pagewidget.
*/
public function removePagewidget(Pagewidget $pagewidget)
{
$this->pagewidgets->removeElement($pagewidget);
}
/**
* Get pagewidgets.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getPagewidgets()
{
return $this->pagewidgets;
}
/**
* Add widget.
*
* @return Icon
*/
public function addWidget(Widget $widget)
{
$this->widgets[] = $widget;
return $this;
}
/**
* Remove widget.
*/
public function removeWidget(Widget $widget)
{
$this->widgets->removeElement($widget);
}
/**
* Get widgets.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getWidgets()
{
return $this->widgets;
}
/**
* Add bookmark.
*
* @return Icon
*/
public function addBookmark(Bookmark $bookmark)
{
$this->bookmarks[] = $bookmark;
return $this;
}
/**
* Remove bookmark.
*/
public function removeBookmark(Bookmark $bookmark)
{
$this->bookmarks->removeElement($bookmark);
}
/**
* Get bookmarks.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getBookmarks()
{
return $this->bookmarks;
}
/**
* Add group.
*
* @return Icon
*/
public function addGroup(Group $group)
{
$this->groups[] = $group;
return $this;
}
/**
* Remove group.
*/
public function removeGroup(Group $group)
{
$this->groups->removeElement($group);
}
/**
* Get groups.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getGroups()
{
return $this->groups;
}
/**
* Set tags.
*
* @param string $tags
*
* @return Icon
*/
public function setTags($tags)
{
$this->tags = $tags;
return $this;
}
/**
* Get tags.
*
* @return string
*/
public function getTags()
{
return $this->tags;
}
}

359
src/Entity/Item.php Executable file
View File

@@ -0,0 +1,359 @@
<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="item")
* @ORM\Entity(repositoryClass="App\Repository\ItemRepository")
*/
class Item
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="title", type="string", length=100)
*/
private $title;
/**
* @var string
*
* @ORM\Column(name="subtitle", type="string", length=250, nullable=true)
*/
private $subtitle;
/**
* @var string
*
* @ORM\Column(length=128, unique=true, nullable=true)
*/
private $slug;
/**
* @var string
*
* @ORM\Column(name="url", type="string", length=500)
*/
private $url;
/**
* @var string
*
* @ORM\Column(name="target", type="string", length=32)
*/
private $target;
/**
* @var string
*
* @ORM\Column(name="content", type="text", nullable=true)
*/
private $content;
/**
* @var int
*
* @ORM\Column(name="rowOrder", type="integer", nullable=true)
*/
private $rowOrder;
/**
* @var bool
*
* @ORM\Column(name="essential", type="boolean", nullable=true, options={"default":false})
*/
private $essential = false;
/**
* @var bool
*
* @ORM\Column(name="protected", type="boolean", nullable=true, options={"default":false})
*/
private $protected;
/**
* @var string
*
* @ORM\Column(name="color", type="string", length=24, nullable=true)
*/
private $color;
/**
* @var string
*
* @ORM\Column(name="roles", type="array", nullable=true)
*/
private $roles;
/**
* @ORM\ManyToOne(targetEntity="Icon", inversedBy="items")
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
*/
private $icon;
/**
* @var ArrayCollection
* @var Bookmark
*
* @ORM\OneToMany(targetEntity="Bookmark", mappedBy="item", cascade={"persist"}, orphanRemoval=true)
*/
private $bookmarks;
/**
* @ORM\ManyToOne(targetEntity="Itemcategory", inversedBy="items")
* @ORM\JoinColumn(name="category", referencedColumnName="id", nullable=false, onDelete="CASCADE")
*/
protected $itemcategory;
/**
* @ORM\ManyToMany(targetEntity="Group", inversedBy="items", cascade={"persist"})
* @ORM\JoinTable(name="itemgroupe",
* joinColumns={@ORM\JoinColumn(name="item", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="groupe", referencedColumnName="id")}
* )
*/
protected $groups;
public function __construct()
{
$this->bookmarks = new ArrayCollection();
$this->groups = new ArrayCollection();
}
// A garder pour forcer l'id en init
public function setId($id)
{
$this->id = $id;
return $this;
}
public function getId(): ?int
{
return $this->id;
}
public function getTitle(): ?string
{
return $this->title;
}
public function setTitle(string $title): self
{
$this->title = $title;
return $this;
}
public function getSubtitle(): ?string
{
return $this->subtitle;
}
public function setSubtitle(?string $subtitle): self
{
$this->subtitle = $subtitle;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(?string $slug): self
{
$this->slug = $slug;
return $this;
}
public function getUrl(): ?string
{
return $this->url;
}
public function setUrl(string $url): self
{
$this->url = $url;
return $this;
}
public function getTarget(): ?string
{
return $this->target;
}
public function setTarget(string $target): self
{
$this->target = $target;
return $this;
}
public function getContent(): ?string
{
return $this->content;
}
public function setContent(?string $content): self
{
$this->content = $content;
return $this;
}
public function getRowOrder(): ?int
{
return $this->rowOrder;
}
public function setRowOrder(?int $rowOrder): self
{
$this->rowOrder = $rowOrder;
return $this;
}
public function isEssential(): ?bool
{
return $this->essential;
}
public function setEssential(?bool $essential): self
{
$this->essential = $essential;
return $this;
}
public function isProtected(): ?bool
{
return $this->protected;
}
public function setProtected(?bool $protected): self
{
$this->protected = $protected;
return $this;
}
public function getColor(): ?string
{
return $this->color;
}
public function setColor(?string $color): self
{
$this->color = $color;
return $this;
}
public function getRoles(): array
{
return $this->roles;
}
public function setRoles(?array $roles): self
{
$this->roles = $roles;
return $this;
}
public function getIcon(): ?Icon
{
return $this->icon;
}
public function setIcon(?Icon $icon): self
{
$this->icon = $icon;
return $this;
}
/**
* @return Collection<int, Bookmark>
*/
public function getBookmarks(): Collection
{
return $this->bookmarks;
}
public function addBookmark(Bookmark $bookmark): self
{
if (!$this->bookmarks->contains($bookmark)) {
$this->bookmarks->add($bookmark);
$bookmark->setItem($this);
}
return $this;
}
public function removeBookmark(Bookmark $bookmark): self
{
if ($this->bookmarks->removeElement($bookmark)) {
// set the owning side to null (unless already changed)
if ($bookmark->getItem() === $this) {
$bookmark->setItem(null);
}
}
return $this;
}
public function getItemcategory(): ?Itemcategory
{
return $this->itemcategory;
}
public function setItemcategory(?Itemcategory $itemcategory): self
{
$this->itemcategory = $itemcategory;
return $this;
}
/**
* @return Collection<int, Group>
*/
public function getGroups(): Collection
{
return $this->groups;
}
public function addGroup(Group $group): self
{
if (!$this->groups->contains($group)) {
$this->groups->add($group);
}
return $this;
}
public function removeGroup(Group $group): self
{
$this->groups->removeElement($group);
return $this;
}
}

213
src/Entity/Itemcategory.php Executable file
View File

@@ -0,0 +1,213 @@
<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* @ORM\Entity
* @ORM\Table(name="itemcategory")
* @ORM\HasLifecycleCallbacks
* @UniqueEntity(fields="label", message="Une Catégorie existe déjà avec ce label")
*/
class Itemcategory
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="label", type="string", length=100)
*/
private $label;
/**
* @var string
*
* @ORM\Column(name="color", type="string", length=24, nullable=true)
*/
private $color;
/**
* @var int
*
* @ORM\Column(name="rowOrder", type="integer", nullable=true)
*/
private $rowOrder;
/**
* @ORM\ManyToOne(targetEntity="Icon", inversedBy="itemcategorys")
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
*/
private $icon;
/**
* @var ArrayCollection
* @var UserGroup
*
* @ORM\OneToMany(targetEntity="Item", mappedBy="itemcategory", cascade={"persist"}, orphanRemoval=true)
* @ORM\OrderBy({"rowOrder" = "ASC","title" = "ASC"})
*/
protected $items;
// A garder pour forcer l'id en init
public function setId($id)
{
$this->id = $id;
return $this;
}
/**
* Constructor.
*/
public function __construct()
{
$this->items = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set label.
*
* @param string $label
*
* @return Itemcategory
*/
public function setLabel($label)
{
$this->label = $label;
return $this;
}
/**
* Get label.
*
* @return string
*/
public function getLabel()
{
return $this->label;
}
/**
* Set color.
*
* @param string $color
*
* @return Itemcategory
*/
public function setColor($color)
{
$this->color = $color;
return $this;
}
/**
* Get color.
*
* @return string
*/
public function getColor()
{
return $this->color;
}
/**
* Set rowOrder.
*
* @param int $rowOrder
*
* @return Itemcategory
*/
public function setRowOrder($rowOrder)
{
$this->rowOrder = $rowOrder;
return $this;
}
/**
* Get rowOrder.
*
* @return int
*/
public function getRowOrder()
{
return $this->rowOrder;
}
/**
* Set icon.
*
* @param Icon $icon
*
* @return Itemcategory
*/
public function setIcon(Icon $icon = null)
{
$this->icon = $icon;
return $this;
}
/**
* Get icon.
*
* @return Icon
*/
public function getIcon()
{
return $this->icon;
}
/**
* Add item.
*
* @return Itemcategory
*/
public function addItem(Item $item)
{
$this->items[] = $item;
return $this;
}
/**
* Remove item.
*/
public function removeItem(Item $item)
{
$this->items->removeElement($item);
}
/**
* Get items.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getItems()
{
return $this->items;
}
}

642
src/Entity/Page.php Executable file
View File

@@ -0,0 +1,642 @@
<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
/**
* Page.
*
* @ORM\Entity
* @ORM\Table(name="page")
* @ORM\Entity(repositoryClass="App\Repository\PageRepository")
*/
class Page
{
/**
* @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 int
*
* @ORM\Column(name="roworder", type="integer")
*/
private $roworder;
/**
* @var int
*
* @ORM\Column(name="maxwidth", type="integer")
*/
private $maxwidth;
/**
* @var string
*
* @ORM\Column(name="fonticon", type="string", nullable=true)
*/
private $fonticon;
/**
* @var string
*
* @ORM\Column(name="url", type="text", nullable=true)
*/
private $url;
/**
* @var bool
*
* @ORM\Column(name="toreload", type="boolean", nullable=true)
*/
private $toreload;
/**
* @var string
*
* @ORM\Column(name="html", type="text", nullable=true)
*/
private $html;
/**
* @var string
*
* @ORM\Column(name="template", type="array", nullable=true)
*/
private $template;
/**
* @var string
*
* @ORM\Column(name="parentfor", type="string", nullable=true)
*/
protected $parentfor;
/**
* @var string
*
* @ORM\Column(name="roles", type="array", nullable=true)
*/
private $roles;
/**
* @ORM\ManyToOne(targetEntity="Pagecategory", inversedBy="pages")
*/
private $pagecategory;
/**
* @ORM\ManyToMany(targetEntity="Group", inversedBy="pages", cascade={"persist"})
* @ORM\JoinTable(name="pagegroupe",
* joinColumns={@ORM\JoinColumn(name="page", referencedColumnName="id")},
* inverseJoinColumns={@ORM\JoinColumn(name="groupe", referencedColumnName="id")}
* )
*/
protected $groups;
/**
* @ORM\ManyToOne(targetEntity="User", inversedBy="pages")
* @ORM\JoinColumn(nullable=true)
*/
private $user;
/**
* @var ArrayCollection
* @var Pagewidget
*
* @ORM\OneToMany(targetEntity="Pagewidget", mappedBy="page", cascade={"persist"}, orphanRemoval=true)
* @ORM\OrderBy({"loc" = "ASC", "roworder" = "ASC"})
*/
private $pagewidgets;
/**
* @ORM\ManyToOne(targetEntity="Page", inversedBy="pages")
* @ORM\JoinColumn(nullable=true, onDelete="SET NULL")
*/
private $page;
/**
* @var ArrayCollection
* @var Page
*
* @ORM\OneToMany(targetEntity="Page", mappedBy="page", cascade={"persist"}, orphanRemoval=false)
*/
private $pages;
/**
* @var ArrayCollection
* @var Group
*
* @ORM\OneToMany(targetEntity="Group", mappedBy="pagetemplate", cascade={"persist"}, orphanRemoval=false)
*/
private $templategroups;
/* champs calculé non stocké en base */
private $canupdate;
public function getCanupdate()
{
return $this->canupdate;
}
public function setCanupdate($canupdate)
{
$this->canupdate = $canupdate;
return $this;
}
/* champs calculé non stocké en base */
private $counterread;
public function getCounterRead()
{
return $this->counterread;
}
public function setCounterRead($counterread)
{
$this->counterread = $counterread;
return $this;
}
// A garder pour forcer l'id en init
public function setId($id)
{
$this->id = $id;
return $this;
}
/**
* Constructor.
*/
public function __construct()
{
$this->groups = new \Doctrine\Common\Collections\ArrayCollection();
$this->pagewidgets = new \Doctrine\Common\Collections\ArrayCollection();
$this->pages = new \Doctrine\Common\Collections\ArrayCollection();
$this->templategroups = new ArrayCollection();
}
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set name.
*
* @param string $name
*
* @return Page
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name.
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set roworder.
*
* @param int $roworder
*
* @return Page
*/
public function setRoworder($roworder)
{
$this->roworder = $roworder;
return $this;
}
/**
* Get roworder.
*
* @return int
*/
public function getRoworder()
{
return $this->roworder;
}
/**
* Set maxwidth.
*
* @param int $maxwidth
*
* @return Page
*/
public function setMaxwidth($maxwidth)
{
$this->maxwidth = $maxwidth;
return $this;
}
/**
* Get maxwidth.
*
* @return int
*/
public function getMaxwidth()
{
return $this->maxwidth;
}
/**
* Set url.
*
* @param string $url
*
* @return Page
*/
public function setUrl($url)
{
$this->url = $url;
return $this;
}
/**
* Get url.
*
* @return string
*/
public function getUrl()
{
return $this->url;
}
/**
* Set html.
*
* @param string $html
*
* @return Page
*/
public function setHtml($html)
{
$this->html = $html;
return $this;
}
/**
* Get html.
*
* @return string
*/
public function getHtml()
{
return $this->html;
}
/**
* Set template.
*
* @param array $template
*
* @return Page
*/
public function setTemplate($template)
{
$this->template = $template;
return $this;
}
/**
* Get template.
*
* @return array
*/
public function getTemplate()
{
return $this->template;
}
/**
* Set parentfor.
*
* @param string $parentfor
*
* @return Page
*/
public function setParentfor($parentfor)
{
$this->parentfor = $parentfor;
return $this;
}
/**
* Get parentfor.
*
* @return string
*/
public function getParentfor()
{
return $this->parentfor;
}
/**
* Set roles.
*
* @param array $roles
*
* @return Page
*/
public function setRoles($roles)
{
$this->roles = $roles;
return $this;
}
/**
* Get roles.
*
* @return array
*/
public function getRoles()
{
return $this->roles;
}
/**
* Set pagecategory.
*
* @param Pagecategory $pagecategory
*
* @return Page
*/
public function setPagecategory(Pagecategory $pagecategory = null)
{
$this->pagecategory = $pagecategory;
return $this;
}
/**
* Get pagecategory.
*
* @return Pagecategory
*/
public function getPagecategory()
{
return $this->pagecategory;
}
/**
* Add group.
*
* @return Page
*/
public function addGroup(Group $group)
{
$this->groups[] = $group;
return $this;
}
/**
* Remove group.
*/
public function removeGroup(Group $group)
{
$this->groups->removeElement($group);
}
/**
* Get groups.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getGroups()
{
return $this->groups;
}
/**
* Set user.
*
* @param User $user
*
* @return Page
*/
public function setUser(User $user = null)
{
$this->user = $user;
return $this;
}
/**
* Get user.
*
* @return User
*/
public function getUser()
{
return $this->user;
}
/**
* Add pagewidget.
*
* @return Page
*/
public function addPagewidget(Pagewidget $pagewidget)
{
$this->pagewidgets[] = $pagewidget;
return $this;
}
/**
* Remove pagewidget.
*/
public function removePagewidget(Pagewidget $pagewidget)
{
$this->pagewidgets->removeElement($pagewidget);
}
/**
* Get pagewidgets.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getPagewidgets()
{
return $this->pagewidgets;
}
/**
* Set page.
*
* @param Page $page
*
* @return Page
*/
public function setPage(Page $page = null)
{
$this->page = $page;
return $this;
}
/**
* Get page.
*
* @return Page
*/
public function getPage()
{
return $this->page;
}
/**
* Add page.
*
* @return Page
*/
public function addPage(Page $page)
{
$this->pages[] = $page;
return $this;
}
/**
* Remove page.
*/
public function removePage(Page $page)
{
$this->pages->removeElement($page);
}
/**
* Get pages.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getPages()
{
return $this->pages;
}
/**
* Add templategroup.
*
* @return Page
*/
public function addTemplategroup(Group $templategroup)
{
$this->templategroups[] = $templategroup;
return $this;
}
/**
* Remove templategroup.
*/
public function removeTemplategroup(Group $templategroup)
{
$this->templategroups->removeElement($templategroup);
}
/**
* Get templategroups.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getTemplategroups()
{
return $this->templategroups;
}
/**
* Set fonticon.
*
* @param string $fonticon
*
* @return Page
*/
public function setFonticon($fonticon)
{
$this->fonticon = $fonticon;
return $this;
}
/**
* Get fonticon.
*
* @return string
*/
public function getFonticon()
{
return $this->fonticon;
}
/**
* Set toreload.
*
* @param bool $toreload
*
* @return Page
*/
public function setToreload($toreload)
{
$this->toreload = $toreload;
return $this;
}
/**
* Get toreload.
*
* @return bool
*/
public function getToreload()
{
return $this->toreload;
}
public function isToreload(): ?bool
{
return $this->toreload;
}
}

119
src/Entity/Pagecategory.php Executable file
View File

@@ -0,0 +1,119 @@
<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
/**
* Pagetype.
*
* @ORM\Entity
* @ORM\Table(name="pagecategory")
*/
class Pagecategory
{
/**
* @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 ArrayCollection
* @var Page
*
* @ORM\OneToMany(targetEntity="Page", mappedBy="pagecategory", cascade={"persist"}, orphanRemoval=false)
*/
private $pages;
// A garder pour forcer l'id en init
public function setId($id)
{
$this->id = $id;
return $this;
}
/**
* Constructor.
*/
public function __construct()
{
$this->pages = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set name.
*
* @param string $name
*
* @return Pagecategory
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name.
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Add page.
*
* @return Pagecategory
*/
public function addPage(Page $page)
{
$this->pages[] = $page;
return $this;
}
/**
* Remove page.
*/
public function removePage(Page $page)
{
$this->pages->removeElement($page);
}
/**
* Get pages.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getPages()
{
return $this->pages;
}
}

602
src/Entity/Pagewidget.php Executable file
View File

@@ -0,0 +1,602 @@
<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\ORM\Mapping as ORM;
/**
* Pagewidget.
*
* @ORM\Entity
* @ORM\Table(name="pagewidget")
*/
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;
/**
* @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
*
* @ORM\OneToMany(targetEntity="Slide", mappedBy="pagewidget", cascade={"persist"}, orphanRemoval=true)
*/
private $slides;
// A garder pour forcer l'id en init
public function setId($id)
{
$this->id = $id;
return $this;
}
/**
* Constructor.
*/
public function __construct()
{
$this->bookmarks = new \Doctrine\Common\Collections\ArrayCollection();
$this->slides = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set name.
*
* @param string $name
*
* @return Pagewidget
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name.
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set loc.
*
* @param string $loc
*
* @return Pagewidget
*/
public function setLoc($loc)
{
$this->loc = $loc;
return $this;
}
/**
* Get loc.
*
* @return string
*/
public function getLoc()
{
return $this->loc;
}
/**
* Set roworder.
*
* @param int $roworder
*
* @return Pagewidget
*/
public function setRoworder($roworder)
{
$this->roworder = $roworder;
return $this;
}
/**
* Get roworder.
*
* @return int
*/
public function getRoworder()
{
return $this->roworder;
}
/**
* Set height.
*
* @param int $height
*
* @return Pagewidget
*/
public function setHeight($height)
{
$this->height = $height;
return $this;
}
/**
* Get height.
*
* @return int
*/
public function getHeight()
{
return $this->height;
}
/**
* Set autoajust.
*
* @param bool $autoajust
*
* @return Pagewidget
*/
public function setAutoajust($autoajust)
{
$this->autoajust = $autoajust;
return $this;
}
/**
* Get autoajust.
*
* @return bool
*/
public function getAutoajust()
{
return $this->autoajust;
}
/**
* Set border.
*
* @param bool $border
*
* @return Pagewidget
*/
public function setBorder($border)
{
$this->border = $border;
return $this;
}
/**
* Get border.
*
* @return bool
*/
public function getBorder()
{
return $this->border;
}
/**
* Set opened.
*
* @param bool $opened
*
* @return Pagewidget
*/
public function setOpened($opened)
{
$this->opened = $opened;
return $this;
}
/**
* Get opened.
*
* @return bool
*/
public function getOpened()
{
return $this->opened;
}
/**
* Set colorheaderback.
*
* @param string $colorheaderback
*
* @return Pagewidget
*/
public function setColorheaderback($colorheaderback)
{
$this->colorheaderback = $colorheaderback;
return $this;
}
/**
* Get colorheaderback.
*
* @return string
*/
public function getColorheaderback()
{
return $this->colorheaderback;
}
/**
* Set colorheaderfont.
*
* @param string $colorheaderfont
*
* @return Pagewidget
*/
public function setColorheaderfont($colorheaderfont)
{
$this->colorheaderfont = $colorheaderfont;
return $this;
}
/**
* Get colorheaderfont.
*
* @return string
*/
public function getColorheaderfont()
{
return $this->colorheaderfont;
}
/**
* Set colorbodyback.
*
* @param string $colorbodyback
*
* @return Pagewidget
*/
public function setColorbodyback($colorbodyback)
{
$this->colorbodyback = $colorbodyback;
return $this;
}
/**
* Get colorbodyback.
*
* @return string
*/
public function getColorbodyback()
{
return $this->colorbodyback;
}
/**
* Set colorbodyfont.
*
* @param string $colorbodyfont
*
* @return Pagewidget
*/
public function setColorbodyfont($colorbodyfont)
{
$this->colorbodyfont = $colorbodyfont;
return $this;
}
/**
* Get colorbodyfont.
*
* @return string
*/
public function getColorbodyfont()
{
return $this->colorbodyfont;
}
/**
* Set parameter.
*
* @param array $parameter
*
* @return Pagewidget
*/
public function setParameter($parameter)
{
$this->parameter = $parameter;
return $this;
}
/**
* Get parameter.
*
* @return array
*/
public function getParameter()
{
return $this->parameter;
}
/**
* Set page.
*
* @param Page $page
*
* @return Pagewidget
*/
public function setPage(Page $page = null)
{
$this->page = $page;
return $this;
}
/**
* Get page.
*
* @return Page
*/
public function getPage()
{
return $this->page;
}
/**
* Set widget.
*
* @param Widget $widget
*
* @return Pagewidget
*/
public function setWidget(Widget $widget = null)
{
$this->widget = $widget;
return $this;
}
/**
* Get widget.
*
* @return Widget
*/
public function getWidget()
{
return $this->widget;
}
/**
* Set icon.
*
* @param Icon $icon
*
* @return Pagewidget
*/
public function setIcon(Icon $icon = null)
{
$this->icon = $icon;
return $this;
}
/**
* Get icon.
*
* @return Icon
*/
public function getIcon()
{
return $this->icon;
}
/**
* Add bookmark.
*
* @return Pagewidget
*/
public function addBookmark(Bookmark $bookmark)
{
$this->bookmarks[] = $bookmark;
return $this;
}
/**
* Remove bookmark.
*/
public function removeBookmark(Bookmark $bookmark)
{
$this->bookmarks->removeElement($bookmark);
}
/**
* Get bookmarks.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getBookmarks()
{
return $this->bookmarks;
}
/**
* Add slide.
*
* @return Pagewidget
*/
public function addSlide(Slide $slide)
{
$this->slides[] = $slide;
return $this;
}
/**
* Remove slide.
*/
public function removeSlide(Slide $slide)
{
$this->slides->removeElement($slide);
}
/**
* Get slides.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getSlides()
{
return $this->slides;
}
public function isAutoajust(): ?bool
{
return $this->autoajust;
}
public function isBorder(): ?bool
{
return $this->border;
}
public function isOpened(): ?bool
{
return $this->opened;
}
}

246
src/Entity/Slide.php Executable file
View File

@@ -0,0 +1,246 @@
<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity
* @ORM\Table(name="slide")
*/
class Slide
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="title", type="string", length=100, nullable=true)
*/
private $title;
/**
* @var string
*
* @ORM\Column(name="subtitle", type="string", length=250, nullable=true)
*/
private $subtitle;
/**
* @var string
*
* @ORM\Column(name="url", type="string", length=500, nullable=true)
*/
private $url;
/**
* @var string
*
* @ORM\Column(name="target", type="string", length=32)
*/
private $target;
/**
* @var int
*
* @ORM\Column(name="roworder", type="integer", nullable=true)
*/
private $roworder;
/**
* @var string
*
* @ORM\Column(name="image", type="string", length=100, nullable=true)
*/
private $image;
/**
* @ORM\ManyToOne(targetEntity="Pagewidget", inversedBy="slides")
*/
private $pagewidget;
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set title.
*
* @param string $title
*
* @return Slide
*/
public function setTitle($title)
{
$this->title = $title;
return $this;
}
/**
* Get title.
*
* @return string
*/
public function getTitle()
{
return $this->title;
}
/**
* Set subtitle.
*
* @param string $subtitle
*
* @return Slide
*/
public function setSubtitle($subtitle)
{
$this->subtitle = $subtitle;
return $this;
}
/**
* Get subtitle.
*
* @return string
*/
public function getSubtitle()
{
return $this->subtitle;
}
/**
* Set url.
*
* @param string $url
*
* @return Slide
*/
public function setUrl($url)
{
$this->url = $url;
return $this;
}
/**
* Get url.
*
* @return string
*/
public function getUrl()
{
return $this->url;
}
/**
* Set target.
*
* @param string $target
*
* @return Slide
*/
public function setTarget($target)
{
$this->target = $target;
return $this;
}
/**
* Get target.
*
* @return string
*/
public function getTarget()
{
return $this->target;
}
/**
* Set roworder.
*
* @param int $roworder
*
* @return Slide
*/
public function setRoworder($roworder)
{
$this->roworder = $roworder;
return $this;
}
/**
* Get roworder.
*
* @return int
*/
public function getRoworder()
{
return $this->roworder;
}
/**
* Set image.
*
* @param string $image
*
* @return Slide
*/
public function setImage($image)
{
$this->image = $image;
return $this;
}
/**
* Get image.
*
* @return string
*/
public function getImage()
{
return $this->image;
}
/**
* Set pagewidget.
*
* @param Pagewidget $pagewidget
*
* @return Slide
*/
public function setPagewidget(Pagewidget $pagewidget = null)
{
$this->pagewidget = $pagewidget;
return $this;
}
/**
* Get pagewidget.
*
* @return Pagewidget
*/
public function getPagewidget()
{
return $this->pagewidget;
}
}

568
src/Entity/Widget.php Executable file
View File

@@ -0,0 +1,568 @@
<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
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;
/**
* @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;
// A garder pour forcer l'id en init
public function setId($id)
{
$this->id = $id;
return $this;
}
/**
* Constructor.
*/
public function __construct()
{
$this->pagewidgets = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Get id.
*
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* Set roworder.
*
* @param int $roworder
*
* @return Widget
*/
public function setRoworder($roworder)
{
$this->roworder = $roworder;
return $this;
}
/**
* Get roworder.
*
* @return int
*/
public function getRoworder()
{
return $this->roworder;
}
/**
* Set name.
*
* @param string $name
*
* @return Widget
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* Get name.
*
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* Set description.
*
* @param string $description
*
* @return Widget
*/
public function setDescription($description)
{
$this->description = $description;
return $this;
}
/**
* Get description.
*
* @return string
*/
public function getDescription()
{
return $this->description;
}
/**
* Set routeview.
*
* @param string $routeview
*
* @return Widget
*/
public function setRouteview($routeview)
{
$this->routeview = $routeview;
return $this;
}
/**
* Get routeview.
*
* @return string
*/
public function getRouteview()
{
return $this->routeview;
}
/**
* Set height.
*
* @param int $height
*
* @return Widget
*/
public function setHeight($height)
{
$this->height = $height;
return $this;
}
/**
* Get height.
*
* @return int
*/
public function getHeight()
{
return $this->height;
}
/**
* Set autoajust.
*
* @param bool $autoajust
*
* @return Widget
*/
public function setAutoajust($autoajust)
{
$this->autoajust = $autoajust;
return $this;
}
/**
* Get autoajust.
*
* @return bool
*/
public function getAutoajust()
{
return $this->autoajust;
}
/**
* Set border.
*
* @param bool $border
*
* @return Widget
*/
public function setBorder($border)
{
$this->border = $border;
return $this;
}
/**
* Get border.
*
* @return bool
*/
public function getBorder()
{
return $this->border;
}
/**
* Set opened.
*
* @param bool $opened
*
* @return Widget
*/
public function setOpened($opened)
{
$this->opened = $opened;
return $this;
}
/**
* Get opened.
*
* @return bool
*/
public function getOpened()
{
return $this->opened;
}
/**
* Set colorheaderback.
*
* @param string $colorheaderback
*
* @return Widget
*/
public function setColorheaderback($colorheaderback)
{
$this->colorheaderback = $colorheaderback;
return $this;
}
/**
* Get colorheaderback.
*
* @return string
*/
public function getColorheaderback()
{
return $this->colorheaderback;
}
/**
* Set colorheaderfont.
*
* @param string $colorheaderfont
*
* @return Widget
*/
public function setColorheaderfont($colorheaderfont)
{
$this->colorheaderfont = $colorheaderfont;
return $this;
}
/**
* Get colorheaderfont.
*
* @return string
*/
public function getColorheaderfont()
{
return $this->colorheaderfont;
}
/**
* Set colorbodyback.
*
* @param string $colorbodyback
*
* @return Widget
*/
public function setColorbodyback($colorbodyback)
{
$this->colorbodyback = $colorbodyback;
return $this;
}
/**
* Get colorbodyback.
*
* @return string
*/
public function getColorbodyback()
{
return $this->colorbodyback;
}
/**
* Set colorbodyfont.
*
* @param string $colorbodyfont
*
* @return Widget
*/
public function setColorbodyfont($colorbodyfont)
{
$this->colorbodyfont = $colorbodyfont;
return $this;
}
/**
* Get colorbodyfont.
*
* @return string
*/
public function getColorbodyfont()
{
return $this->colorbodyfont;
}
/**
* Set access.
*
* @param string $access
*
* @return Widget
*/
public function setAccess($access)
{
$this->access = $access;
return $this;
}
/**
* Get access.
*
* @return string
*/
public function getAccess()
{
return $this->access;
}
/**
* Set parameter.
*
* @param array $parameter
*
* @return Widget
*/
public function setParameter($parameter)
{
$this->parameter = $parameter;
return $this;
}
/**
* Get parameter.
*
* @return array
*/
public function getParameter()
{
return $this->parameter;
}
/**
* Set icon.
*
* @param Icon $icon
*
* @return Widget
*/
public function setIcon(Icon $icon = null)
{
$this->icon = $icon;
return $this;
}
/**
* Get icon.
*
* @return Icon
*/
public function getIcon()
{
return $this->icon;
}
/**
* Add pagewidget.
*
* @return Widget
*/
public function addPagewidget(Pagewidget $pagewidget)
{
$this->pagewidgets[] = $pagewidget;
return $this;
}
/**
* Remove pagewidget.
*/
public function removePagewidget(Pagewidget $pagewidget)
{
$this->pagewidgets->removeElement($pagewidget);
}
/**
* Get pagewidgets.
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getPagewidgets()
{
return $this->pagewidgets;
}
public function isAutoajust(): ?bool
{
return $this->autoajust;
}
public function isBorder(): ?bool
{
return $this->border;
}
public function isOpened(): ?bool
{
return $this->opened;
}
}