Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Entity;
- use Doctrine\ORM\Mapping as ORM;
- /**
- * @ORM\Entity(repositoryClass="App\Repository\ArticleRepository")
- */
- class Article
- {
- /**
- * @ORM\Id()
- * @ORM\GeneratedValue()
- * @ORM\Column(type="integer")
- */
- private $id;
- /**
- * @ORM\Column(type="string", length=255)
- */
- private $title;
- /**
- * @ORM\Column(type="string", length=255)
- */
- private $Desription;
- /**
- * @ORM\Column(type="string", length=255)
- */
- private $h1;
- /**
- * @ORM\Column(type="integer")
- * @ORM\ManyToOne(targetEntity="App\Entity\Category", inversedBy="articles")
- */
- protected $category;
- /**
- * @ORM\Column(type="string", length=255)
- */
- private $img;
- /**
- * @ORM\Column(type="text")
- */
- private $Content;
- public function getId(): ?int
- {
- return $this->id;
- }
- public function getTitle(): ?string
- {
- return $this->title;
- }
- public function setTitle(string $title): self
- {
- $this->title = $title;
- return $this;
- }
- public function getDesription(): ?string
- {
- return $this->Desription;
- }
- public function setDesription(string $Desription): self
- {
- $this->Desription = $Desription;
- return $this;
- }
- public function getH1(): ?string
- {
- return $this->h1;
- }
- public function setH1(string $h1): self
- {
- $this->h1 = $h1;
- return $this;
- }
- public function getImg(): ?string
- {
- return $this->img;
- }
- public function setImg(string $img): self
- {
- $this->img = $img;
- return $this;
- }
- public function getContent(): ?string
- {
- return $this->Content;
- }
- public function setContent(string $Content): self
- {
- $this->Content = $Content;
- return $this;
- }
- /**
- * @return mixed
- */
- public function getCategory() : ?string
- {
- return $this->category;
- }
- /**
- * @param mixed $category
- */
- public function setCategory($category): self
- {
- $this->category = $category;
- return $this;
- }
- // public function getNameCategory($category)
- // {
- // return $this->getDoctrine()
- // ->getRepository(Category::class)
- // ->find($category)->name;
- // }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement