src/Entity/BFChallengeEdition.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. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\BFChallengeEditionRepository")
  8.  */
  9. class BFChallengeEdition
  10. {
  11.     /**
  12.      * @ORM\Id()
  13.      * @ORM\GeneratedValue()
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\ManyToOne(targetEntity="App\Entity\BFChallenge", inversedBy="editions")
  19.      * @ORM\JoinColumn(nullable=false)
  20.      */
  21.     private $challenge;
  22.     /**
  23.      * @ORM\Column(type="string", length=255)
  24.      */
  25.     private $name;
  26.     /**
  27.      * @ORM\ManyToMany(targetEntity="App\Entity\BFEdition", inversedBy="challengeeditions")
  28.      * @ORM\OrderBy({"startdate" = "ASC", "enddate"="ASC"})
  29.      */
  30.     private $editions;
  31.     /**
  32.      * @ORM\Column(type="datetime")
  33.      */
  34.     private $creationdate;
  35.     /**
  36.      * @ORM\Column(type="boolean")
  37.      */
  38.     private $isactive;
  39.     /**
  40.      * @ORM\OneToOne(targetEntity="App\Entity\BFDescriptionChallengeEdition", inversedBy="edition", cascade={"persist", "remove"})
  41.      * @ORM\JoinColumn(nullable=false)
  42.      */
  43.     private $description;
  44.     public function __construct()
  45.     {
  46.         $this->editions = new ArrayCollection();
  47.         $this->creationdate = new \DateTime('now');
  48.         $this->description=new BFDescriptionChallengeEdition();
  49.         $this->isactive=false;
  50.     }
  51.     public function getId(): ?int
  52.     {
  53.         return $this->id;
  54.     }
  55.     public function getChallenge(): ?BFChallenge
  56.     {
  57.         return $this->challenge;
  58.     }
  59.     public function setChallenge(?BFChallenge $challenge): self
  60.     {
  61.         $this->challenge $challenge;
  62.         return $this;
  63.     }
  64.     public function getName(): ?string
  65.     {
  66.         return $this->name;
  67.     }
  68.     public function setName(string $name): self
  69.     {
  70.         $this->name $name;
  71.         return $this;
  72.     }
  73.     /**
  74.      * @return Collection|BFEdition[]
  75.      */
  76.     public function getEditions(): Collection
  77.     {
  78.         return $this->editions;
  79.     }
  80.     public function addEdition(BFEdition $edition): self
  81.     {
  82.         if (!$this->editions->contains($edition)) {
  83.             $this->editions[] = $edition;
  84.         }
  85.         return $this;
  86.     }
  87.     public function removeEdition(BFEdition $edition): self
  88.     {
  89.         if ($this->editions->contains($edition)) {
  90.             $this->editions->removeElement($edition);
  91.         }
  92.         return $this;
  93.     }
  94.     public function getCreationdate(): ?\DateTimeInterface
  95.     {
  96.         return $this->creationdate;
  97.     }
  98.     public function setCreationdate(\DateTimeInterface $creationdate): self
  99.     {
  100.         $this->creationdate $creationdate;
  101.         return $this;
  102.     }
  103.     public function getDescription(): ?BFDescriptionChallengeEdition
  104.     {
  105.         return $this->description;
  106.     }
  107.     public function setDescription(?BFDescriptionChallengeEdition $description): self
  108.     {
  109.         $this->description $description;
  110.         // set (or unset) the owning side of the relation if necessary
  111.         $newEdition null === $description null $this;
  112.         if ($description->getEdition() !== $newEdition) {
  113.             $description->setEdition($newEdition);
  114.         }
  115.         return $this;
  116.     }
  117.     public function getIsactive(): ?bool
  118.     {
  119.         return $this->isactive;
  120.     }
  121.     public function setIsactive(bool $isactive): self
  122.     {
  123.         $this->isactive $isactive;
  124.         return $this;
  125.     }
  126. }