Advertisement
Guest User

Untitled

a guest
Jan 22nd, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.48 KB | None | 0 0
  1. <?php
  2.  
  3. namespace App\Entity;
  4.  
  5. use Doctrine\ORM\Mapping as ORM;
  6.  
  7. /**
  8.  * @ORM\Entity(repositoryClass="App\Repository\ArticleRepository")
  9.  */
  10. class Article
  11. {
  12.     /**
  13.      * @ORM\Id()
  14.      * @ORM\GeneratedValue()
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.  
  19.     /**
  20.      * @ORM\Column(type="string", length=255)
  21.      */
  22.     private $title;
  23.  
  24.     /**
  25.      * @ORM\Column(type="string", length=255)
  26.      */
  27.     private $Desription;
  28.  
  29.     /**
  30.      * @ORM\Column(type="string", length=255)
  31.      */
  32.     private $h1;
  33.  
  34.     /**
  35.      * @ORM\Column(type="integer")
  36.      * @ORM\ManyToOne(targetEntity="App\Entity\Category",  inversedBy="articles")
  37.      */
  38.     protected $category;
  39.  
  40.     /**
  41.      * @ORM\Column(type="string", length=255)
  42.      */
  43.     private $img;
  44.  
  45.     /**
  46.      * @ORM\Column(type="text")
  47.      */
  48.     private $Content;
  49.  
  50.     public function getId(): ?int
  51.     {
  52.         return $this->id;
  53.     }
  54.  
  55.     public function getTitle(): ?string
  56.     {
  57.         return $this->title;
  58.     }
  59.  
  60.     public function setTitle(string $title): self
  61.     {
  62.         $this->title = $title;
  63.  
  64.         return $this;
  65.     }
  66.  
  67.     public function getDesription(): ?string
  68.     {
  69.         return $this->Desription;
  70.     }
  71.  
  72.     public function setDesription(string $Desription): self
  73.     {
  74.         $this->Desription = $Desription;
  75.  
  76.         return $this;
  77.     }
  78.  
  79.     public function getH1(): ?string
  80.     {
  81.         return $this->h1;
  82.     }
  83.  
  84.     public function setH1(string $h1): self
  85.     {
  86.         $this->h1 = $h1;
  87.  
  88.         return $this;
  89.     }
  90.  
  91.     public function getImg(): ?string
  92.     {
  93.         return $this->img;
  94.     }
  95.  
  96.     public function setImg(string $img): self
  97.     {
  98.         $this->img = $img;
  99.  
  100.         return $this;
  101.     }
  102.  
  103.     public function getContent(): ?string
  104.     {
  105.         return $this->Content;
  106.     }
  107.  
  108.     public function setContent(string $Content): self
  109.     {
  110.         $this->Content = $Content;
  111.  
  112.         return $this;
  113.     }
  114.  
  115.     /**
  116.      * @return mixed
  117.      */
  118.     public function getCategory() : ?string
  119.     {
  120.         return $this->category;
  121.     }
  122.  
  123.     /**
  124.      * @param mixed $category
  125.      */
  126.     public function setCategory($category): self
  127.     {
  128.         $this->category = $category;
  129.  
  130.         return $this;
  131.     }
  132.  
  133. //    public function getNameCategory($category)
  134. //    {
  135. //        return $this->getDoctrine()
  136. //            ->getRepository(Category::class)
  137. //            ->find($category)->name;
  138. //    }
  139.  
  140.  
  141. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement