Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.95 KB | None | 0 0
  1. <?php
  2.  
  3. declare(strict_types = 1);
  4.  
  5. namespace App\Entity;
  6.  
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9.  
  10. /**
  11.  * @ORM\Entity()
  12.  */
  13. class Article
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue(strategy="AUTO")
  18.      * @ORM\Column(type="integer", options={"unsigned":true})
  19.      *
  20.      * @var int
  21.      */
  22.     protected $id;
  23.  
  24.     /**
  25.      * @ORM\Column(type="string", length=115, nullable=false)
  26.      *
  27.      * @Assert\Type(type="string")
  28.      * @Assert\Length(max="115")
  29.      * @Assert\NotBlank()
  30.      *
  31.      * @var string
  32.      */
  33.     protected $titre;
  34.  
  35.     public function getId(): ?int
  36.     {
  37.         return $this->id;
  38.     }
  39.  
  40.     public function setId(int $id): void
  41.     {
  42.         $this->id = $id;
  43.     }
  44.  
  45.     public function getTitre(): ?string
  46.     {
  47.         return $this->titre;
  48.     }
  49.  
  50.     public function setTitre(string $titre): void
  51.     {
  52.         $this->titre = $titre;
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement