src/Entity/Sav.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SavRepository;
  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=SavRepository::class)
  11.  * @ORM\Table(name="`sav`")
  12.  */
  13. class Sav
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private ?int $id null;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="savs")
  23.      */
  24.     private ?User $user;
  25.     /**
  26.      * @ORM\ManyToOne(targetEntity=Order::class, inversedBy="savs")
  27.      */
  28.     private ?Order $order;
  29.     /**
  30.      * @ORM\ManyToOne(targetEntity=Cart::class, inversedBy="savs")
  31.      */
  32.     private ?Cart $cart;
  33.     /**
  34.      * @ORM\ManyToMany(targetEntity=Imei::class, mappedBy="savs", cascade={"persist"})
  35.      */
  36.     private $imeis;
  37.     /**
  38.      * @ORM\Column(type="datetime", nullable=true)
  39.      */
  40.     private $date;
  41.     /**
  42.      * @ORM\ManyToOne(targetEntity=Status::class, inversedBy="savs")
  43.      */
  44.     private $status;
  45.     /**
  46.      * @ORM\Column(type="text", nullable=false)
  47.      */
  48.     private $reason;
  49.     /**
  50.      * @ORM\Column(type="text", nullable=true)
  51.      * @Assert\Expression(
  52.      *      "true !== this.getReason()",
  53.      *      message="Veuillez préciser une autre raison ou selectionner une raison proposée"
  54.      *  )
  55.      */
  56.     private $other;
  57.     /**
  58.      * @ORM\Column(type="text", nullable=true)
  59.      */
  60.      private $description;
  61.     /**
  62.      * @ORM\Column(type="text", nullable=true)
  63.      */
  64.     private $comment;
  65.     public function __construct()
  66.     {
  67.         $this->imeis = new ArrayCollection();
  68.     }
  69.     public function getId(): ?int
  70.     {
  71.         return $this->id;
  72.     }
  73.     public function getDate(): ?\DateTimeInterface
  74.     {
  75.         return $this->date;
  76.     }
  77.     public function setDate(?\DateTimeInterface $date): static
  78.     {
  79.         $this->date $date;
  80.         return $this;
  81.     }
  82.     public function getUser(): ?User
  83.     {
  84.         return $this->user;
  85.     }
  86.     public function setUser(?User $user): static
  87.     {
  88.         $this->user $user;
  89.         return $this;
  90.     }
  91.     public function getOrder(): ?Order
  92.     {
  93.         return $this->order;
  94.     }
  95.     public function setOrder(?Order $order): static
  96.     {
  97.         $this->order $order;
  98.         return $this;
  99.     }
  100.     public function getCart(): ?Cart
  101.     {
  102.         return $this->cart;
  103.     }
  104.     public function setCart(?Cart $cart): static
  105.     {
  106.         $this->cart $cart;
  107.         return $this;
  108.     }
  109.     public function getStatus(): ?Status
  110.     {
  111.         return $this->status;
  112.     }
  113.     public function setStatus(?Status $status): static
  114.     {
  115.         $this->status $status;
  116.         return $this;
  117.     }
  118.     /**
  119.      * @return Collection<int, Imei>
  120.      */
  121.     public function getImeis(): Collection
  122.     {
  123.         return $this->imeis;
  124.     }
  125.     public function addImei(Imei $imei): static
  126.     {
  127.         if (!$this->imeis->contains($imei)) {
  128.             $this->imeis->add($imei);
  129.         }
  130.         return $this;
  131.     }
  132.     public function removeImei(Imei $imei): static
  133.     {
  134.         $this->imeis->removeElement($imei);
  135.         return $this;
  136.     }
  137.     public function setReason($reason) {
  138.         $this->reason $reason;
  139.     }
  140.     public function getReason() {
  141.         return $this->reason;
  142.     }
  143.     public function setOther($other) {
  144.         $this->other $other;
  145.     }
  146.     public function getOther() {
  147.         return $this->other;
  148.     }
  149.     public function getDescription(): ?string
  150.     {
  151.         return $this->description;
  152.     }
  153.     public function setDescription(?string $description): static
  154.     {
  155.         $this->description $description;
  156.         return $this;
  157.     }
  158.     public function getComment(): ?string
  159.     {
  160.         return $this->comment;
  161.     }
  162.     public function setComment(?string $comment): static
  163.     {
  164.         $this->comment $comment;
  165.         return $this;
  166.     }
  167. }