<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="App\Repository\WebEngineRepository")
*/
class WebEngine
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, nullable=true, options={"comment":"Nom du moteur"})
*/
private $name;
/**
* @ORM\Column(type="boolean", nullable=true, options={"comment":"True si la premiere section alimente la zone des filtres rapides)"})
*/
private $useFirstSectionForQuickFilters;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="App\Entity\WebEngineSection", mappedBy="engine", cascade={"persist","remove"})
* @ORM\OrderBy({"ordering" = "ASC"})
*/
private $sections;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="App\Entity\WebList", mappedBy="webEngine", cascade={"persist"})
*/
private $webLists;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="webEngines")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="owner_id", referencedColumnName="id")
* })
*/
private $owner;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\DnsitEntity", inversedBy="webEngines")
* @ORM\JoinColumns({
* @ORM\JoinColumn(name="entity_id", referencedColumnName="id")
* })
*/
private $entity;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Tag", inversedBy="webEngines")
*/
private $tags;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $createdAt;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @ORM\Column(type="integer", nullable=true, options={"default":0, "comment":"code de statut : 0=OK"})
*/
private $state;
public function __construct()
{
$this->sections = new ArrayCollection();
$this->webLists = new ArrayCollection();
$this->tags = new ArrayCollection();
}
public function getId() : ?int
{
return $this->id;
}
public function getName() : ?string
{
return $this->name;
}
public function setName(?string $name) : self
{
$this->name = $name;
return $this;
}
public function getCreatedAt() : ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt) : self
{
$this->createdAt = $createdAt;
return $this;
}
public function getUpdatedAt() : ?\DateTimeInterface
{
return $this->updatedAt;
}
public function setUpdatedAt(?\DateTimeInterface $updatedAt) : self
{
$this->updatedAt = $updatedAt;
return $this;
}
public function getState() : ?int
{
return $this->state;
}
public function setState(?int $state) : self
{
$this->state = $state;
return $this;
}
public function getOwner() : ?User
{
return $this->owner;
}
public function setOwner(?User $owner) : self
{
$this->owner = $owner;
return $this;
}
public function getEntity() : ?DnsitEntity
{
return $this->entity;
}
public function setEntity(?DnsitEntity $entity) : self
{
$this->entity = $entity;
return $this;
}
/**
* @return Collection|WebEngineSection[]
*/
public function getSections() : Collection
{
return $this->sections;
}
public function addSection(WebEngineSection $section) : self
{
if (!$this->sections->contains($section)) {
$this->sections[] = $section;
$section->setEngine($this);
}
return $this;
}
public function removeSection(WebEngineSection $section) : self
{
if ($this->sections->contains($section)) {
$this->sections->removeElement($section);
// set the owning side to null (unless already changed)
if ($section->getEngine() === $this) {
$section->setEngine(null);
}
}
return $this;
}
/**
* @return Collection|WebList[]
*/
public function getWebLists() : Collection
{
return $this->webLists;
}
public function addWebList(WebList $webList) : self
{
if (!$this->webLists->contains($webList)) {
$this->webLists[] = $webList;
$webList->setWebEngine($this);
}
return $this;
}
public function removeWebList(WebList $webList) : self
{
if ($this->webLists->contains($webList)) {
$this->webLists->removeElement($webList);
// set the owning side to null (unless already changed)
if ($webList->getWebEngine() === $this) {
$webList->setWebEngine(null);
}
}
return $this;
}
/**
* @return Collection|Tag[]
*/
public function getTags() : Collection
{
return $this->tags;
}
public function addTag(Tag $tag) : self
{
if (!$this->tags->contains($tag)) {
$this->tags[] = $tag;
}
return $this;
}
public function removeTag(Tag $tag) : self
{
if ($this->tags->contains($tag)) {
$this->tags->removeElement($tag);
}
return $this;
}
// Getters and setters for useFirstSectionForQuickFilters
public function getUseFirstSectionForQuickFilters() : ?bool
{
return $this->useFirstSectionForQuickFilters;
}
public function setUseFirstSectionForQuickFilters(?bool $useFirstSectionForQuickFilters) : self
{
$this->useFirstSectionForQuickFilters = $useFirstSectionForQuickFilters;
return $this;
}
}