src/Entity/AnnonceSpace.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use DateTime;
  7. /**
  8.  * @ORM\Entity(repositoryClass="App\Repository\AnnonceSpaceRepository")
  9.  */
  10. class AnnonceSpace
  11. {
  12.     /**
  13.      * @ORM\Id()
  14.      * @ORM\GeneratedValue()
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private ?int $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private ?string $name;
  22.     /**
  23.      * @ORM\Column(type="datetime", nullable=true)
  24.      */
  25.     private ?DateTime $createdAt;
  26.     /**
  27.      * @ORM\Column(type="datetime", nullable=true)
  28.      */
  29.     private ?DateTime $updatedAt;
  30.     /**
  31.      * @ORM\Column(type="integer", nullable=true, options={"default":0, "comment":"code de statut : 0=OK"})
  32.      */
  33.     private ?int $state;
  34.     /**
  35.      * @ORM\Column(type="boolean", nullable=true, options={"default":false})
  36.      */
  37.     private ?bool $hasDynamicAnnonces;
  38.     /**
  39.      * @ORM\ManyToOne(targetEntity="App\Entity\TagAnnonce", inversedBy="annonceSpaces")
  40.      * @ORM\JoinColumns({
  41.      *   @ORM\JoinColumn(name="tag_annonce_id", referencedColumnName="id")
  42.      * })
  43.      */
  44.     private ?TagAnnonce $tagAnnonce;
  45.     /**
  46.      * @ORM\ManyToMany(targetEntity="App\Entity\Annonce", inversedBy="annonceSpaces")
  47.      */
  48.     private $annonces;
  49.     /**
  50.      * @ORM\ManyToOne(targetEntity="App\Entity\User", inversedBy="annonceSpaces")
  51.      * @ORM\JoinColumns({
  52.      *   @ORM\JoinColumn(name="owner_id", referencedColumnName="id")
  53.      * })
  54.      */
  55.     private $owner;
  56.     /**
  57.      * @ORM\ManyToOne(targetEntity="App\Entity\DnsitEntity", inversedBy="annonceSpaces")
  58.      * @ORM\JoinColumns({
  59.      *   @ORM\JoinColumn(name="entity_id", referencedColumnName="id")
  60.      * })
  61.      */
  62.     private $entity;
  63.     public function __construct()
  64.     {
  65.         $this->annonces = new ArrayCollection();
  66.     }
  67.     public function getId() : ?int
  68.     {
  69.         return $this->id;
  70.     }
  71.     public function getName() : ?string
  72.     {
  73.         return $this->name;
  74.     }
  75.     public function setName(?string $name) : self
  76.     {
  77.         $this->name $name;
  78.         return $this;
  79.     }
  80.     public function getTagAnnonce() : ?TagAnnonce
  81.     {
  82.         return $this->tagAnnonce;
  83.     }
  84.     public function setTagAnnonce(?TagAnnonce $tagAnnonce) : self
  85.     {
  86.         $this->tagAnnonce $tagAnnonce;
  87.         return $this;
  88.     }
  89.     /**
  90.      * @return Collection|Annonce[]
  91.      */
  92.     public function getAnnonces() : Collection
  93.     {
  94.         return $this->annonces;
  95.     }
  96.     public function addAnnonce(Annonce $annonce) : self
  97.     {
  98.         if (!$this->annonces->contains($annonce)) {
  99.             $this->annonces[] = $annonce;
  100.         }
  101.         return $this;
  102.     }
  103.     public function removeAnnonce(Annonce $annonce) : self
  104.     {
  105.         if ($this->annonces->contains($annonce)) {
  106.             $this->annonces->removeElement($annonce);
  107.         }
  108.         return $this;
  109.     }
  110.     public function getCreatedAt() : ?DateTime
  111.     {
  112.         return $this->createdAt;
  113.     }
  114.     public function setCreatedAt(?DateTime $createdAt) : self
  115.     {
  116.         $this->createdAt $createdAt;
  117.         return $this;
  118.     }
  119.     public function getUpdatedAt() : ?DateTime
  120.     {
  121.         return $this->updatedAt;
  122.     }
  123.     public function setUpdatedAt(?DateTime $updatedAt) : self
  124.     {
  125.         $this->updatedAt $updatedAt;
  126.         return $this;
  127.     }
  128.     public function getState() : ?int
  129.     {
  130.         return $this->state;
  131.     }
  132.     public function setState(?int $state) : self
  133.     {
  134.         $this->state $state;
  135.         return $this;
  136.     }
  137.     public function getHasDynamicAnnonces(): ?bool
  138.     {
  139.         return $this->hasDynamicAnnonces;
  140.     }
  141.     public function setHasDynamicAnnonces(?bool $hasDynamicAnnonces): self
  142.     {
  143.         $this->hasDynamicAnnonces $hasDynamicAnnonces;
  144.         return $this;
  145.     }
  146. }