src/Entity/Tutorial.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TutorialRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassTutorialRepository::class)]
  8. class Tutorial
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'string'length255)]
  15.     private $title;
  16.     #[ORM\Column(type'text'nullabletrue)]
  17.     private $description;
  18.     #[ORM\Column(type'string'length255nullabletrue)]
  19.     private $video;
  20.     #[ORM\Column(type'string'length255nullabletrue)]
  21.     private $photo;
  22.     #[ORM\OneToMany(targetEntityComment::class, mappedBy'tutorial')]
  23.     private $comments;
  24.     #[ORM\ManyToMany(targetEntityTutorialCategory::class, mappedBy'tutorials')]
  25.     private $categories;
  26.     #[ORM\Column(type'datetime')]
  27.     private $createdAt;
  28.     #[ORM\Column(type'string'length255)]
  29.     private $slug;
  30.     #[ORM\Column(type'boolean')]
  31.     private $original;
  32.     #[ORM\Column(type'integer'nullabletrue)]
  33.     private $unit;
  34.     #[ORM\ManyToOne(targetEntityWebsiteLanguage::class, inversedBy'tutorials')]
  35.     private $websiteLanguage;
  36.     #[ORM\Column(type'string'length255)]
  37.     private $status;
  38.     public function __construct()
  39.     {
  40.         $this->comments = new ArrayCollection();
  41.         $this->categories = new ArrayCollection();
  42.     }
  43.     public function getId(): ?int
  44.     {
  45.         return $this->id;
  46.     }
  47.     public function getTitle(): ?string
  48.     {
  49.         return $this->title;
  50.     }
  51.     public function setTitle(string $title): self
  52.     {
  53.         $this->title $title;
  54.         return $this;
  55.     }
  56.     public function getDescription(): ?string
  57.     {
  58.         return $this->description;
  59.     }
  60.     public function setDescription(?string $description): self
  61.     {
  62.         $this->description $description;
  63.         return $this;
  64.     }
  65.     public function getVideo(): ?string
  66.     {
  67.         return $this->video;
  68.     }
  69.     public function setVideo(?string $video): self
  70.     {
  71.         $this->video $video;
  72.         return $this;
  73.     }
  74.     public function getPhoto()
  75.     {
  76.         return $this->photo;
  77.     }
  78.     public function setPhoto($photo): self
  79.     {
  80.         $this->photo $photo;
  81.         return $this;
  82.     }
  83.     /**
  84.      * @return Collection|Comment[]
  85.      */
  86.     public function getComments(): Collection
  87.     {
  88.         return $this->comments;
  89.     }
  90.     public function addComment(Comment $comment): self
  91.     {
  92.         if (!$this->comments->contains($comment)) {
  93.             $this->comments[] = $comment;
  94.             $comment->setTutorial($this);
  95.         }
  96.         return $this;
  97.     }
  98.     public function removeComment(Comment $comment): self
  99.     {
  100.         if ($this->comments->removeElement($comment)) {
  101.             // set the owning side to null (unless already changed)
  102.             if ($comment->getTutorial() === $this) {
  103.                 $comment->setTutorial(null);
  104.             }
  105.         }
  106.         return $this;
  107.     }
  108.     /**
  109.      * @return Collection|TutorialCategory[]
  110.      */
  111.     public function getCategories(): Collection
  112.     {
  113.         return $this->categories;
  114.     }
  115.     public function addCategory(TutorialCategory $category): self
  116.     {
  117.         if (!$this->categories->contains($category)) {
  118.             $this->categories[] = $category;
  119.             $category->addTutorial($this);
  120.         }
  121.         return $this;
  122.     }
  123.     public function removeCategory(TutorialCategory $category): self
  124.     {
  125.         if ($this->categories->removeElement($category)) {
  126.             $category->removeTutorial($this);
  127.         }
  128.         return $this;
  129.     }
  130.     public function getCreatedAt(): ?\DateTimeInterface
  131.     {
  132.         return $this->createdAt;
  133.     }
  134.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  135.     {
  136.         $this->createdAt $createdAt;
  137.         return $this;
  138.     }
  139.     public function getSlug(): ?string
  140.     {
  141.         return $this->slug;
  142.     }
  143.     public function setSlug(string $slug): self
  144.     {
  145.         $this->slug $slug;
  146.         return $this;
  147.     }
  148.     public function getOriginal(): ?bool
  149.     {
  150.         return $this->original;
  151.     }
  152.     public function setOriginal(bool $original): self
  153.     {
  154.         $this->original $original;
  155.         return $this;
  156.     }
  157.     public function getUnit(): ?int
  158.     {
  159.         return $this->unit;
  160.     }
  161.     public function setUnit(?int $unit): self
  162.     {
  163.         $this->unit $unit;
  164.         return $this;
  165.     }
  166.     public function getWebsiteLanguage(): ?WebsiteLanguage
  167.     {
  168.         return $this->websiteLanguage;
  169.     }
  170.     public function setWebsiteLanguage(?WebsiteLanguage $websiteLanguage): self
  171.     {
  172.         $this->websiteLanguage $websiteLanguage;
  173.         return $this;
  174.     }
  175.     public function getStatus(): ?string
  176.     {
  177.         return $this->status;
  178.     }
  179.     public function setStatus(string $status): self
  180.     {
  181.         $this->status $status;
  182.         return $this;
  183.     }
  184. }