<?php
namespace App\Entity;
use App\Repository\ModeleRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* @ORM\Entity(repositoryClass=ModeleRepository::class)
*/
class Modele
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="integer", options={"default":0})
*/
private $nombreBoutons = 0;
/**
* @ORM\Column(type="string", length=255)
* @Assert\NotBlank
*/
private $libelle;
/**
* @ORM\Column(type="integer")
* @Assert\NotBlank
*/
private $cout;
/**
* @ORM\Column(type="integer")
* @Assert\NotBlank
*/
private $garantie;
/**
* @ORM\Column(type="blob", nullable=true)
*/
private $photo1;
/**
* @ORM\Column(type="blob", nullable=true)
*/
private $photo2;
/**
* @ORM\Column(type="blob", nullable=true)
*/
private $photo3;
/**
* @ORM\Column(type="integer")
* @Assert\NotBlank
*/
private $dureeVie;
/**
* @ORM\ManyToOne(targetEntity=TypeDevice::class, inversedBy="modeles")
* @Assert\NotBlank
*/
private $typeDevice;
/**
* @ORM\ManyToMany(targetEntity=Reseau::class, inversedBy="modeles", cascade={"persist"})
*/
private $reseaux;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\Column(type="string", length=255)
* @Assert\NotBlank
*/
private $fonction;
/**
* @ORM\OneToMany(targetEntity=Scenario::class, mappedBy="modele")
*/
private $scenarios;
/**
* @ORM\Column(type="boolean")
*/
private $isArchive = 0;
/**
* @ORM\OneToMany(targetEntity=Device::class, mappedBy="modele")
*/
private $devices;
public function __construct()
{
$this->reseaux = new ArrayCollection();
$this->scenarios = new ArrayCollection();
$this->devices = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNombreBoutons(): ?int
{
return $this->nombreBoutons;
}
public function setNombreBoutons(int $nombreBoutons): self
{
$this->nombreBoutons = $nombreBoutons;
return $this;
}
public function getLibelle(): ?string
{
return $this->libelle;
}
public function setLibelle(string $libelle): self
{
$this->libelle = $libelle;
return $this;
}
public function getCout(): ?int
{
return $this->cout;
}
public function setCout(int $cout): self
{
$this->cout = $cout;
return $this;
}
public function getGarantie(): ?int
{
return $this->garantie;
}
public function setGarantie(int $garantie): self
{
$this->garantie = $garantie;
return $this;
}
public function getPhoto1()
{
return $this->photo1;
}
public function setPhoto1($photo1): self
{
$this->photo1 = $photo1;
return $this;
}
public function getPhoto2()
{
return $this->photo2;
}
public function setPhoto2($photo2): self
{
$this->photo2 = $photo2;
return $this;
}
public function getPhoto3()
{
return $this->photo3;
}
public function setPhoto3($photo3): self
{
$this->photo3 = $photo3;
return $this;
}
public function getDureeVie(): ?int
{
return $this->dureeVie;
}
public function setDureeVie(int $dureeVie): self
{
$this->dureeVie = $dureeVie;
return $this;
}
public function getTypeDevice(): ?TypeDevice
{
return $this->typeDevice;
}
public function setTypeDevice(?TypeDevice $typeDevice): self
{
$this->typeDevice = $typeDevice;
return $this;
}
/**
* @return Collection|Reseau[]
*/
public function getReseaux(): Collection
{
return $this->reseaux;
}
public function addReseaux(Reseau $reseaux): self
{
if (!$this->reseaux->contains($reseaux)) {
$this->reseaux[] = $reseaux;
}
return $this;
}
public function removeReseaux(Reseau $reseaux): self
{
if ($this->reseaux->contains($reseaux)) {
$this->reseaux->removeElement($reseaux);
}
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getFonction(): ?string
{
return $this->fonction;
}
public function setFonction(string $fonction): self
{
$this->fonction = $fonction;
return $this;
}
/**
* @return Collection|Scenario[]
*/
public function getScenarios(): Collection
{
return $this->scenarios;
}
public function addScenario(Scenario $scenario): self
{
if (!$this->scenarios->contains($scenario)) {
$this->scenarios[] = $scenario;
$scenario->setModele($this);
}
return $this;
}
public function removeScenario(Scenario $scenario): self
{
if ($this->scenarios->contains($scenario)) {
$this->scenarios->removeElement($scenario);
// set the owning side to null (unless already changed)
if ($scenario->getModele() === $this) {
$scenario->setModele(null);
}
}
return $this;
}
public function getIsArchive(): ?bool
{
return $this->isArchive;
}
public function setIsArchive(bool $isArchive): self
{
$this->isArchive = $isArchive;
return $this;
}
/**
* @return Collection|Device[]
*/
public function getDevices(): Collection
{
return $this->devices;
}
public function addDevice(Device $device): self
{
if (!$this->devices->contains($device)) {
$this->devices[] = $device;
$device->setModele($this);
}
return $this;
}
public function removeDevice(Device $device): self
{
if ($this->devices->contains($device)) {
$this->devices->removeElement($device);
// set the owning side to null (unless already changed)
if ($device->getModele() === $this) {
$device->setModele(null);
}
}
return $this;
}
public function isArchive(): ?bool
{
return $this->isArchive;
}
public function isIsArchive(): ?bool
{
return $this->isArchive;
}
}