Advertisement
SanderCokart

Todo.php

Feb 2nd, 2020
223
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.11 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\TodoRepository")
  9.  */
  10. class Todo
  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 $name;
  23.  
  24.     /**
  25.      * @ORM\Column(type="string", length=500)
  26.      */
  27.     private $description;
  28.  
  29.     public function getId(): ?int
  30.     {
  31.         return $this->id;
  32.     }
  33.  
  34.     public function getName(): ?string
  35.     {
  36.         return $this->name;
  37.     }
  38.  
  39.     public function setName(string $name): self
  40.     {
  41.         $this->name = $name;
  42.  
  43.         return $this;
  44.     }
  45.  
  46.     public function getDescription(): ?string
  47.     {
  48.         return $this->description;
  49.     }
  50.  
  51.     public function setDescription(string $description): self
  52.     {
  53.         $this->description = $description;
  54.  
  55.         return $this;
  56.     }
  57.  
  58.     public function toArray()
  59.     {
  60.         return ['id' => $this->id, 'name' => $this->name, 'description' => $this->description];
  61.     }
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement