src/Entity/Avis.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AvisRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. /**
  9.  * @ORM\Entity(repositoryClass=AvisRepository::class)
  10.  */
  11. class Avis
  12. {
  13.     /**
  14.      * @ORM\Id()
  15.      * @ORM\GeneratedValue()
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="float")
  21.      *
  22.      * @Assert\NotBlank(message="Veuillez noter la qualité du service")
  23.      */
  24.     private $serviceQuality;
  25.     /**
  26.      * @ORM\Column(type="float")
  27.      *
  28.      * @Assert\NotBlank(message="Veuillez noter la fiabilité du prestataire")
  29.      */
  30.     private $fiability;
  31.     /**
  32.      * @ORM\Column(type="float")
  33.      *
  34.      * @Assert\NotBlank(message="Veuillez noter le prix du produit")
  35.      */
  36.     private $price;
  37.     /**
  38.      * @ORM\Column(type="float")
  39.      *
  40.      * @Assert\NotBlank(message="Veuillez noter la rapidité de la livraison")
  41.      */
  42.     private $speed;
  43.     /**
  44.      * @ORM\Column(type="text", nullable=true)
  45.      */
  46.     private $text;
  47.     /**
  48.      * @ORM\Column(type="float")
  49.      *
  50.      * @Assert\NotBlank(message="Veuillez noter la conformité du produit")
  51.      */
  52.     private $conformDescription;
  53.     /**
  54.      * @ORM\Column(type="float")
  55.      *
  56.      * @Assert\NotBlank(message="Veuillez noter la communication du prestataire")
  57.      */
  58.     private $communication;
  59.     /**
  60.      * @ORM\ManyToOne(targetEntity=Product::class, inversedBy="avis")
  61.      */
  62.     private $product;
  63.     /**
  64.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="avis")
  65.      */
  66.     private $client;
  67.     /**
  68.      * @ORM\Column(type="float")
  69.      */
  70.     private $globalNote;
  71.     /**
  72.      * @ORM\Column(type="datetime", nullable=true)
  73.      */
  74.     private $createdAt;
  75.     /**
  76.      * @ORM\Column(type="text", nullable=true)
  77.      */
  78.     private $responseCompany;
  79.     /**
  80.      * @ORM\Column(type="boolean", nullable=true)
  81.      */
  82.     private $isDesactivatedByAdmin;
  83.     /**
  84.      * @ORM\OneToMany(targetEntity=ImageComment::class, mappedBy="avis")
  85.      */
  86.     private $imageComments;
  87.     public function __construct()
  88.     {
  89.         $this->createdAt = new \DateTime();
  90.         $this->imageComments = new ArrayCollection();
  91.     }
  92.     public function getId(): ?int
  93.     {
  94.         return $this->id;
  95.     }
  96.     public function getServiceQuality(): ?float
  97.     {
  98.         return $this->serviceQuality;
  99.     }
  100.     public function setServiceQuality(float $serviceQuality): self
  101.     {
  102.         $this->serviceQuality $serviceQuality;
  103.         return $this;
  104.     }
  105.     public function getFiability(): ?float
  106.     {
  107.         return $this->fiability;
  108.     }
  109.     public function setFiability(float $fiability): self
  110.     {
  111.         $this->fiability $fiability;
  112.         return $this;
  113.     }
  114.     public function getPrice(): ?float
  115.     {
  116.         return $this->price;
  117.     }
  118.     public function setPrice(float $price): self
  119.     {
  120.         $this->price $price;
  121.         return $this;
  122.     }
  123.     public function getSpeed(): ?float
  124.     {
  125.         return $this->speed;
  126.     }
  127.     public function setSpeed(float $speed): self
  128.     {
  129.         $this->speed $speed;
  130.         return $this;
  131.     }
  132.     public function getText(): ?string
  133.     {
  134.         return $this->text;
  135.     }
  136.     public function setText(?string $text): self
  137.     {
  138.         $this->text $text;
  139.         return $this;
  140.     }
  141.     public function getConformDescription(): ?float
  142.     {
  143.         return $this->conformDescription;
  144.     }
  145.     public function setConformDescription(float $conformDescription): self
  146.     {
  147.         $this->conformDescription $conformDescription;
  148.         return $this;
  149.     }
  150.     public function getCommunication(): ?float
  151.     {
  152.         return $this->communication;
  153.     }
  154.     public function setCommunication(float $communication): self
  155.     {
  156.         $this->communication $communication;
  157.         return $this;
  158.     }
  159.     public function getProduct(): ?Product
  160.     {
  161.         return $this->product;
  162.     }
  163.     public function setProduct(?Product $product): self
  164.     {
  165.         $this->product $product;
  166.         return $this;
  167.     }
  168.     public function getClient(): ?User
  169.     {
  170.         return $this->client;
  171.     }
  172.     public function setClient(?User $client): self
  173.     {
  174.         $this->client $client;
  175.         return $this;
  176.     }
  177.     public function getGlobalNote(): ?float
  178.     {
  179.         return $this->globalNote;
  180.     }
  181.     public function setGlobalNote(float $globalNote): self
  182.     {
  183.         $this->globalNote $globalNote;
  184.         return $this;
  185.     }
  186.     public function getCreatedAt(): ?\DateTimeInterface
  187.     {
  188.         return $this->createdAt;
  189.     }
  190.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  191.     {
  192.         $this->createdAt $createdAt;
  193.         return $this;
  194.     }
  195.     public function getResponseCompany(): ?string
  196.     {
  197.         return $this->responseCompany;
  198.     }
  199.     public function setResponseCompany(?string $responseCompany): self
  200.     {
  201.         $this->responseCompany $responseCompany;
  202.         return $this;
  203.     }
  204.     public function getIsDesactivatedByAdmin(): ?bool
  205.     {
  206.         return $this->isDesactivatedByAdmin;
  207.     }
  208.     public function setIsDesactivatedByAdmin(?bool $isDesactivatedByAdmin): self
  209.     {
  210.         $this->isDesactivatedByAdmin $isDesactivatedByAdmin;
  211.         return $this;
  212.     }
  213.     /**
  214.      * @return Collection|ImageComment[]
  215.      */
  216.     public function getImageComments(): Collection
  217.     {
  218.         return $this->imageComments;
  219.     }
  220.     public function addImageComment(ImageComment $imageComment): self
  221.     {
  222.         if (!$this->imageComments->contains($imageComment)) {
  223.             $this->imageComments[] = $imageComment;
  224.             $imageComment->setAvis($this);
  225.         }
  226.         return $this;
  227.     }
  228.     public function removeImageComment(ImageComment $imageComment): self
  229.     {
  230.         if ($this->imageComments->removeElement($imageComment)) {
  231.             // set the owning side to null (unless already changed)
  232.             if ($imageComment->getAvis() === $this) {
  233.                 $imageComment->setAvis(null);
  234.             }
  235.         }
  236.         return $this;
  237.     }
  238. }