src/Entity/FeaturedOffer.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FeaturedOfferRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassFeaturedOfferRepository::class)]
  8. class FeaturedOffer
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'string'length255)]
  15.     private $type;
  16.     #[ORM\Column(type'string'length255)]
  17.     private $duration;
  18.     #[ORM\Column(type'string'length255)]
  19.     private $price;
  20.     #[ORM\OneToMany(targetEntityFeaturedCourse::class, mappedBy'featuredOffer')]
  21.     private $featureds;
  22.     public function __construct()
  23.     {
  24.         $this->featureds = new ArrayCollection();
  25.     }
  26.     public function getId(): ?int
  27.     {
  28.         return $this->id;
  29.     }
  30.     public function getType(): ?string
  31.     {
  32.         return $this->type;
  33.     }
  34.     public function setType(string $type): self
  35.     {
  36.         $this->type $type;
  37.         return $this;
  38.     }
  39.     public function getDuration(): ?string
  40.     {
  41.         return $this->duration;
  42.     }
  43.     public function setDuration(string $duration): self
  44.     {
  45.         $this->duration $duration;
  46.         return $this;
  47.     }
  48.     public function getPrice(): ?string
  49.     {
  50.         return $this->price;
  51.     }
  52.     public function setPrice(string $price): self
  53.     {
  54.         $this->price $price;
  55.         return $this;
  56.     }
  57.     /**
  58.      * @return Collection|FeaturedCourse[]
  59.      */
  60.     public function getFeatureds(): Collection
  61.     {
  62.         return $this->featureds;
  63.     }
  64.     public function addFeatured(FeaturedCourse $featured): self
  65.     {
  66.         if (!$this->featureds->contains($featured)) {
  67.             $this->featureds[] = $featured;
  68.             $featured->setFeaturedOffer($this);
  69.         }
  70.         return $this;
  71.     }
  72.     public function removeFeatured(FeaturedCourse $featured): self
  73.     {
  74.         if ($this->featureds->removeElement($featured)) {
  75.             // set the owning side to null (unless already changed)
  76.             if ($featured->getFeaturedOffer() === $this) {
  77.                 $featured->setFeaturedOffer(null);
  78.             }
  79.         }
  80.         return $this;
  81.     }
  82. }