src/Entity/Articles.php line 14

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 Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  7. use Symfony\Component\Serializer\Annotation\Groups;
  8. /**
  9.  * @ORM\Entity(repositoryClass="App\Repository\ArticlesRepository")
  10.  */
  11. class Articles
  12. {
  13.     /**
  14.      * @ORM\Id()
  15.      * @ORM\GeneratedValue()
  16.      * @ORM\Column(type="integer")
  17.      * @Groups({"main"})
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="string", length=255, unique=true)
  22.      */
  23.     private $url;
  24.     /**
  25.      * @ORM\Column(type="text")
  26.      */
  27.     private $image;
  28.     /**
  29.      * @ORM\Column(type="string", length=255)
  30.      * @Groups({"main"})
  31.      */
  32.     private $title_nl;
  33.     /**
  34.      * @ORM\Column(type="string", length=255)
  35.      * @Groups({"main"})
  36.      */
  37.     private $title_en;
  38.     /**
  39.      * @ORM\Column(type="string", length=255)
  40.      */
  41.     private $description_nl;
  42.     /**
  43.      * @ORM\Column(type="string", length=255)
  44.      */
  45.     private $description_en;
  46.     /**
  47.      * @ORM\Column(type="text")
  48.      */
  49.     private $intro_nl;
  50.     /**
  51.      * @ORM\Column(type="text")
  52.      */
  53.     private $intro_en;
  54.     /**
  55.      * @ORM\Column(type="text")
  56.      */
  57.     private $text_nl;
  58.     /**
  59.      * @ORM\Column(type="text")
  60.      */
  61.     private $text_en;
  62.     /**
  63.      * @ORM\Column(type="datetime")
  64.      */
  65.     private $added;
  66.     /**
  67.      * @ORM\Column(type="integer")
  68.      */
  69.     private $user_id;
  70.     /**
  71.      * @ORM\Column(type="string", length=180, nullable=true)
  72.      */
  73.     private $username;
  74.     /**
  75.      * @ORM\Column(type="datetime", nullable=true)
  76.      */
  77.     private $edited;
  78.     /**
  79.      * @ORM\Column(type="integer", nullable=true)
  80.      */
  81.     private $edited_user_id;
  82.     /**
  83.      * @ORM\Column(type="string", length=180, nullable=true)
  84.      */
  85.     private $edited_username;
  86.     /**
  87.      * @ORM\Column(type="boolean")
  88.      */
  89.     private $approved;
  90.     /**
  91.      * @ORM\Column(type="integer", nullable=true)
  92.      */
  93.     private $approved_user_id;
  94.     /**
  95.      * @ORM\Column(type="string", length=180, nullable=true)
  96.      */
  97.     private $approved_username;
  98.     /**
  99.      * @ORM\ManyToOne(targetEntity="App\Entity\ArticleCategories", inversedBy="articles")
  100.      * @ORM\JoinColumn(nullable=false)
  101.      */
  102.     private $category;
  103.     /**
  104.      * @ORM\OneToMany(targetEntity="App\Entity\ArticleReviews", mappedBy="article", orphanRemoval=true)
  105.      */
  106.     private $articlereviews;
  107.     /**
  108.      * @ORM\Column(type="integer")
  109.      */
  110.     private $num_reviews;
  111.     /**
  112.      * @ORM\Column(type="text", nullable=true)
  113.      */
  114.     private $keywords_nl;
  115.     /**
  116.      * @ORM\Column(type="text", nullable=true)
  117.      */
  118.     private $keywords_en;
  119.     public function __construct()
  120.     {
  121.         $this->reviews = new ArrayCollection();
  122.     }
  123.     public function getId(): ?int
  124.     {
  125.         return $this->id;
  126.     }
  127.     public function getUrl(): ?string
  128.     {
  129.         return $this->url;
  130.     }
  131.     public function setUrl(string $url): self
  132.     {
  133.         $this->url $url;
  134.         return $this;
  135.     }
  136.     public function getImage(): ?string
  137.     {
  138.         return $this->image;
  139.     }
  140.     public function setImage(string $image): self
  141.     {
  142.         $this->image $image;
  143.         return $this;
  144.     }
  145.     public function getTitleNl(): ?string
  146.     {
  147.         return $this->title_nl;
  148.     }
  149.     public function setTitleNl(string $title_nl): self
  150.     {
  151.         $this->title_nl $title_nl;
  152.         return $this;
  153.     }
  154.     public function getTitleEn(): ?string
  155.     {
  156.         return $this->title_en;
  157.     }
  158.     public function setTitleEn(string $title_en): self
  159.     {
  160.         $this->title_en $title_en;
  161.         return $this;
  162.     }
  163.     public function getDescriptionNl(): ?string
  164.     {
  165.         return $this->description_nl;
  166.     }
  167.     public function setDescriptionNl(string $description_nl): self
  168.     {
  169.         $this->description_nl $description_nl;
  170.         return $this;
  171.     }
  172.     public function getDescriptionEn(): ?string
  173.     {
  174.         return $this->description_en;
  175.     }
  176.     public function setDescriptionEn(string $description_en): self
  177.     {
  178.         $this->description_en $description_en;
  179.         return $this;
  180.     }
  181.     public function getIntroNl(): ?string
  182.     {
  183.         return $this->intro_nl;
  184.     }
  185.     public function setIntroNl(string $intro_nl): self
  186.     {
  187.         $this->intro_nl $intro_nl;
  188.         return $this;
  189.     }
  190.     public function getIntroEn(): ?string
  191.     {
  192.         return $this->intro_en;
  193.     }
  194.     public function setIntroEn(string $intro_en): self
  195.     {
  196.         $this->intro_en $intro_en;
  197.         return $this;
  198.     }
  199.     public function getAdded(): ?\DateTimeInterface
  200.     {
  201.         return $this->added;
  202.     }
  203.     public function setAdded(\DateTimeInterface $added): self
  204.     {
  205.         $this->added $added;
  206.         return $this;
  207.     }
  208.     public function getUserId(): ?int
  209.     {
  210.         return $this->user_id;
  211.     }
  212.     public function setUserId(int $user_id): self
  213.     {
  214.         $this->user_id $user_id;
  215.         return $this;
  216.     }
  217.     public function getUsername(): ?string
  218.     {
  219.         return $this->username;
  220.     }
  221.     public function setUsername(?string $username): self
  222.     {
  223.         $this->username $username;
  224.         return $this;
  225.     }
  226.     public function getApproved(): ?bool
  227.     {
  228.         return $this->approved;
  229.     }
  230.     public function setApproved(bool $approved): self
  231.     {
  232.         $this->approved $approved;
  233.         return $this;
  234.     }
  235.     public function getApprovedUserId(): ?int
  236.     {
  237.         return $this->approved_user_id;
  238.     }
  239.     public function setApprovedUserId(?int $approved_user_id): self
  240.     {
  241.         $this->approved_user_id $approved_user_id;
  242.         return $this;
  243.     }
  244.     public function getApprovedUsername(): ?string
  245.     {
  246.         return $this->approved_username;
  247.     }
  248.     public function setApprovedUsername(string $approved_username): self
  249.     {
  250.         $this->approved_username $approved_username;
  251.         return $this;
  252.     }
  253.     public function getEdited(): ?\DateTimeInterface
  254.     {
  255.         return $this->edited;
  256.     }
  257.     public function setEdited(?\DateTimeInterface $edited): self
  258.     {
  259.         $this->edited $edited;
  260.         return $this;
  261.     }
  262.     public function getEditedUserId(): ?int
  263.     {
  264.         return $this->edited_user_id;
  265.     }
  266.     public function setEditedUserId(?int $edited_user_id): self
  267.     {
  268.         $this->edited_user_id $edited_user_id;
  269.         return $this;
  270.     }
  271.     public function getEditedUsername(): ?string
  272.     {
  273.         return $this->edited_username;
  274.     }
  275.     public function setEditedUsername(?string $edited_username): self
  276.     {
  277.         $this->edited_username $edited_username;
  278.         return $this;
  279.     }
  280.     public function getTextNl(): ?string
  281.     {
  282.         return $this->text_nl;
  283.     }
  284.     public function setTextNl(string $text_nl): self
  285.     {
  286.         $this->text_nl $text_nl;
  287.         return $this;
  288.     }
  289.     public function getTextEn(): ?string
  290.     {
  291.         return $this->text_en;
  292.     }
  293.     public function setTextEn(string $text_en): self
  294.     {
  295.         $this->text_en $text_en;
  296.         return $this;
  297.     }
  298.     public function getCategory(): ?ArticleCategories
  299.     {
  300.         return $this->category;
  301.     }
  302.     public function setCategory(?ArticleCategories $category): self
  303.     {
  304.         $this->category $category;
  305.         return $this;
  306.     }
  307.     public function getKeywordsNl(): ?string
  308.     {
  309.         return $this->keywords_nl;
  310.     }
  311.     public function setKeywordsNl(?string $keywords_nl): self
  312.     {
  313.         $this->keywords_nl $keywords_nl;
  314.         return $this;
  315.     }
  316.     public function getKeywordsEn(): ?string
  317.     {
  318.         return $this->keywords_en;
  319.     }
  320.     public function setKeywordsEn(?string $keywords_en): self
  321.     {
  322.         $this->keywords_en $keywords_en;
  323.         return $this;
  324.     }
  325.     /**
  326.      * @return Collection|ArticleReviews[]
  327.      */
  328.     public function getArticleReviews(): Collection
  329.     {
  330.         return $this->articlereviews;
  331.     }
  332.     public function addArticleReview(ArticleReviews $articlereview): self
  333.     {
  334.         if (!$this->articlereviews->contains($articlereview)) {
  335.             $this->articlereviews[] = $articlereview;
  336.             $articlereview->setArticle($this);
  337.         }
  338.         return $this;
  339.     }
  340.     public function removeArticleReview(ArticleReviews $articlereview): self
  341.     {
  342.         if ($this->articlereviews->contains($articlereview)) {
  343.             $this->articlereviews->removeElement($articlereview);
  344.             // set the owning side to null (unless already changed)
  345.             if ($articlereview->getArticle() === $this) {
  346.                 $articlereview->setArticle(null);
  347.             }
  348.         }
  349.         return $this;
  350.     }
  351.     public function getNumReviews(): ?int
  352.     {
  353.         return $this->num_reviews;
  354.     }
  355.     public function setNumReviews(int $num_reviews): self
  356.     {
  357.         $this->num_reviews $num_reviews;
  358.         return $this;
  359.     }
  360. }