src/Entity/Articles/Blocks.php line 22

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Articles;
  3. use Doctrine\DBAL\Types\Types;
  4. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  8. use Symfony\Component\HttpFoundation\File\File;
  9. use Symfony\Component\HttpFoundation\File\UploadedFile;
  10. use Vich\UploaderBundle\Entity\File as EmbeddedFile;
  11. /**
  12.  * Pages
  13.  *
  14.  * @ORM\Table("articles_blocks")
  15.  * @ORM\Entity(repositoryClass="App\Repository\Articles\BlocksRepository")
  16.  * @ORM\HasLifecycleCallbacks()
  17.  * @Vich\Uploadable
  18.  */
  19. class Blocks
  20. {
  21.     /**
  22.      * @var integer
  23.      *
  24.      * @ORM\Column(name="id", type="integer")
  25.      * @ORM\Id
  26.      * @ORM\GeneratedValue(strategy="AUTO")
  27.      */
  28.     protected $id;
  29.     /**
  30.      * @var string
  31.      *
  32.      * @ORM\Column(name="created_at", type="datetime", nullable=true, options={"comment":"Date de création"})
  33.      */
  34.     private $createdAt;
  35.     /**
  36.      * @var string
  37.      *
  38.      * @ORM\Column(name="updated_at", type="datetime", nullable=true, options={"comment":"Date de mise à jour"})
  39.      */
  40.     private $updatedAt;
  41.     /**
  42.      * @var string
  43.      *
  44.      * @ORM\Column(name="identifiant", type="string", length=255, nullable=true)
  45.      */
  46.     private $identifiant;
  47.     /**
  48.      * @var string
  49.      *
  50.      * @ORM\Column(name="title", type="string", length=255, nullable=true)
  51.      */
  52.     private $title;
  53.     /**
  54.      * @var string
  55.      *
  56.      * @ORM\Column(name="description", type="text", nullable=true)
  57.      */
  58.     private $description;
  59.     /**
  60.      * @var string
  61.      *
  62.      * @ORM\Column(name="locale", type="string", length=11, nullable=true)
  63.      */
  64.     private $locale;
  65.     /**
  66.      * @ORM\PrePersist
  67.      */
  68.     public function setCreatedAtValue(): void
  69.     {
  70.         $this->setCreatedAt(new \DateTime("now"));
  71.         $this->setUpdatedAt(new \DateTime("now"));
  72.     }
  73.     /**
  74.      * @ORM\PreUpdate
  75.      */
  76.     public function setUpdatedAtValue(): void
  77.     {
  78.         $this->setUpdatedAt(new \DateTime("now"));
  79.     }
  80.     public function __toString()
  81.     {
  82.         return (string)$this->title;
  83.     }
  84.     public function getId(): ?int
  85.     {
  86.         return $this->id;
  87.     }
  88.     public function getCreatedAt(): ?\DateTimeInterface
  89.     {
  90.         return $this->createdAt;
  91.     }
  92.     public function setCreatedAt(?\DateTimeInterface $createdAt): static
  93.     {
  94.         $this->createdAt $createdAt;
  95.         return $this;
  96.     }
  97.     public function getUpdatedAt(): ?\DateTimeInterface
  98.     {
  99.         return $this->updatedAt;
  100.     }
  101.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): static
  102.     {
  103.         $this->updatedAt $updatedAt;
  104.         return $this;
  105.     }
  106.     public function getIdentifiant(): ?string
  107.     {
  108.         return $this->identifiant;
  109.     }
  110.     public function setIdentifiant(?string $identifiant): static
  111.     {
  112.         $this->identifiant $identifiant;
  113.         return $this;
  114.     }
  115.     public function getTitle(): ?string
  116.     {
  117.         return $this->title;
  118.     }
  119.     public function setTitle(?string $title): static
  120.     {
  121.         $this->title $title;
  122.         return $this;
  123.     }
  124.     public function getDescription(): ?string
  125.     {
  126.         return $this->description;
  127.     }
  128.     public function setDescription(?string $description): static
  129.     {
  130.         $this->description $description;
  131.         return $this;
  132.     }
  133.     public function getLocale(): ?string
  134.     {
  135.         return $this->locale;
  136.     }
  137.     public function setLocale(?string $locale): static
  138.     {
  139.         $this->locale $locale;
  140.         return $this;
  141.     }
  142. }