src/Entity/Device.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DeviceRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. /**
  10.  * @ORM\Entity(repositoryClass=DeviceRepository::class)
  11.  */
  12. class Device
  13. {
  14.     /**
  15.      * @ORM\Id()
  16.      * @ORM\GeneratedValue()
  17.      * @ORM\Column(type="integer")
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="string", length=255)
  22.      */
  23.     private $idClient;
  24.     /**
  25.      * @ORM\Column(type="string", length=255)
  26.      */
  27.     private $libelleClient;
  28.     /**
  29.      * @ORM\Column(type="string", length=255)
  30.      */
  31.     private $numeroSerie;
  32.     /**
  33.      * @ORM\Column(type="float", nullable=true)
  34.      */
  35.     private $voltage;
  36.     /**
  37.      * @ORM\Column(type="date")
  38.      */
  39.     private $dateActivation;
  40.     /**
  41.      * @ORM\Column(type="integer")
  42.      */
  43.     private $isBonEtat 1;
  44.     /**
  45.      * @ORM\Column(type="integer", nullable=true)
  46.      */
  47.     private $pourcentageBatterie;
  48.     /**
  49.      * @ORM\ManyToOne(targetEntity=Modele::class, inversedBy="devices")
  50.      * @ORM\JoinColumn(nullable=false)
  51.      */
  52.     private $modele;
  53.     /**
  54.      * @ORM\ManyToOne(targetEntity=Scenario::class, inversedBy="devices")
  55.      * @ORM\JoinColumn(nullable=false)
  56.      */
  57.     private $scenario;
  58.     /**
  59.      * @ORM\Column(type="string", length=255)
  60.      * @Assert\Length(
  61.      *      min = 16,
  62.      *      max = 16,
  63.      *      exactMessage = "Le code PAC doit être de {{ limit }} caractères")
  64.      */
  65.     private $pac;
  66.     /**
  67.      * @ORM\OneToMany(targetEntity=DataUplinks::class, mappedBy="device")
  68.      */
  69.     private $messagesUplinks;
  70.     /**
  71.      * @ORM\Column(type="string", length=255, nullable=true)
  72.      */
  73.     private $linkQuality;
  74.     /**
  75.      * @ORM\Column(type="datetime", nullable=true)
  76.      */
  77.     private $dateDerniereCommunication;
  78.     /**
  79.      * @ORM\Column(type="string", length=255, nullable=true)
  80.      */
  81.     private $ville;
  82.     /**
  83.      * @ORM\Column(type="string", length=255, nullable=true)
  84.      */
  85.     private $libelle;
  86.     /**
  87.      * @ORM\Column(type="integer", nullable=true)
  88.      */
  89.     private $delaiLimite;
  90.     /**
  91.      * @ORM\Column(type="boolean", nullable=true)
  92.      */
  93.     private $triggerAlert;
  94.     /**
  95.      * @ORM\Column(type="string", length=255, nullable=true)
  96.      */
  97.     private $devEUI;
  98.     /**
  99.      * @ORM\Column(type="string", length=255, nullable=true)
  100.      */
  101.     private $gatewayPath;
  102.     public function __construct()
  103.     {
  104.         $this->messagesUplinks = new ArrayCollection();
  105.     }
  106.     public function getId(): ?int
  107.     {
  108.         return $this->id;
  109.     }
  110.     public function getLibelleClient(): ?string
  111.     {
  112.         return $this->libelleClient;
  113.     }
  114.     public function setLibelleClient(string $libelleClient): self
  115.     {
  116.         $this->libelleClient $libelleClient;
  117.         return $this;
  118.     }
  119.     public function getNumeroSerie(): ?string
  120.     {
  121.         return $this->numeroSerie;
  122.     }
  123.     public function setNumeroSerie(string $numeroSerie): self
  124.     {
  125.         $this->numeroSerie $numeroSerie;
  126.         return $this;
  127.     }
  128.     public function getVoltage(): ?float
  129.     {
  130.         return $this->voltage;
  131.     }
  132.     public function setVoltage(float $voltage): self
  133.     {
  134.         $this->voltage $voltage;
  135.         return $this;
  136.     }
  137.     public function getDateActivation(): ?\DateTimeInterface
  138.     {
  139.         return $this->dateActivation;
  140.     }
  141.     public function setDateActivation(\DateTimeInterface $dateActivation): self
  142.     {
  143.         $this->dateActivation $dateActivation;
  144.         return $this;
  145.     }
  146.     public function getIsBonEtat(): ?int
  147.     {
  148.         return $this->isBonEtat;
  149.     }
  150.     public function setIsBonEtat(int $isBonEtat): self
  151.     {
  152.         $this->isBonEtat $isBonEtat;
  153.         return $this;
  154.     }
  155.     public function getPourcentageBatterie(): ?int
  156.     {
  157.         return $this->pourcentageBatterie;
  158.     }
  159.     public function setPourcentageBatterie(?int $pourcentageBatterie): self
  160.     {
  161.         $this->pourcentageBatterie $pourcentageBatterie;
  162.         return $this;
  163.     }
  164.     public function getModele(): ?Modele
  165.     {
  166.         return $this->modele;
  167.     }
  168.     public function setModele(?Modele $modele): self
  169.     {
  170.         $this->modele $modele;
  171.         return $this;
  172.     }
  173.     public function getScenario(): ?Scenario
  174.     {
  175.         return $this->scenario;
  176.     }
  177.     public function setScenario(?Scenario $scenario): self
  178.     {
  179.         $this->scenario $scenario;
  180.         return $this;
  181.     }
  182.     public function getPac(): ?string
  183.     {
  184.         return $this->pac;
  185.     }
  186.     public function setPac(string $pac): self
  187.     {
  188.         $this->pac $pac;
  189.         return $this;
  190.     }
  191.     /**
  192.      * @return Collection|DataUplinks[]
  193.      */
  194.     public function getMessagesUplinks(): Collection
  195.     {
  196.         return $this->messagesUplinks;
  197.     }
  198.     public function addMessagesUplink(DataUplinks $messagesUplink): self
  199.     {
  200.         if (!$this->messagesUplinks->contains($messagesUplink)) {
  201.             $this->messagesUplinks[] = $messagesUplink;
  202.             $messagesUplink->setDevice($this);
  203.         }
  204.         return $this;
  205.     }
  206.     public function removeMessagesUplink(DataUplinks $messagesUplink): self
  207.     {
  208.         if ($this->messagesUplinks->contains($messagesUplink)) {
  209.             $this->messagesUplinks->removeElement($messagesUplink);
  210.             // set the owning side to null (unless already changed)
  211.             if ($messagesUplink->getDevice() === $this) {
  212.                 $messagesUplink->setDevice(null);
  213.             }
  214.         }
  215.         return $this;
  216.     }
  217.     public function getLinkQuality(): ?string
  218.     {
  219.         return $this->linkQuality;
  220.     }
  221.     public function setLinkQuality(?string $linkQuality): self
  222.     {
  223.         $this->linkQuality $linkQuality;
  224.         return $this;
  225.     }
  226.     public function getDateDerniereCommunication(): ?\DateTimeInterface
  227.     {
  228.         return $this->dateDerniereCommunication;
  229.     }
  230.     public function setDateDerniereCommunication(?\DateTimeInterface $dateDerniereCommunication): self
  231.     {
  232.         $this->dateDerniereCommunication $dateDerniereCommunication;
  233.         return $this;
  234.     }
  235.     public function getVille(): ?string
  236.     {
  237.         return $this->ville;
  238.     }
  239.     public function setVille(?string $ville): self
  240.     {
  241.         $this->ville $ville;
  242.         return $this;
  243.     }
  244.     public function getLibelle(): ?string
  245.     {
  246.         return $this->libelle;
  247.     }
  248.     public function setLibelle(?string $libelle): self
  249.     {
  250.         $this->libelle $libelle;
  251.         return $this;
  252.     }
  253.     public function getDelaiLimite(): ?int
  254.     {
  255.         return $this->delaiLimite;
  256.     }
  257.     public function setDelaiLimite(?int $delaiLimite): self
  258.     {
  259.         $this->delaiLimite $delaiLimite;
  260.         return $this;
  261.     }
  262.     public function getTriggerAlert(): ?bool
  263.     {
  264.         return $this->triggerAlert;
  265.     }
  266.     public function setTriggerAlert(?bool $triggerAlert): self
  267.     {
  268.         $this->triggerAlert $triggerAlert;
  269.         return $this;
  270.     }
  271.     public function isTriggerAlert(): ?bool
  272.     {
  273.         return $this->triggerAlert;
  274.     }
  275.     public function getDevEUI(): ?string
  276.     {
  277.         return $this->devEUI;
  278.     }
  279.     public function setDevEUI(?string $devEUI): self
  280.     {
  281.         $this->devEUI $devEUI;
  282.         return $this;
  283.     }
  284.     public function getIdClient(): ?string
  285.     {
  286.         return $this->idClient;
  287.     }
  288.     public function setIdClient(string $idClient): self
  289.     {
  290.         $this->idClient $idClient;
  291.         return $this;
  292.     }
  293.     public function getGatewayPath(): ?string
  294.     {
  295.         return $this->gatewayPath;
  296.     }
  297.     public function setGatewayPath(?string $gatewayPath): self
  298.     {
  299.         $this->gatewayPath $gatewayPath;
  300.         return $this;
  301.     }
  302. }