src/Entity/Policy.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PolicyRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use DateTimeImmutable;
  6. /**
  7.  * @ORM\Entity(repositoryClass=PolicyRepository::class)
  8.  */
  9. class Policy
  10. {
  11.     /**
  12.      * @ORM\Id
  13.      * @ORM\GeneratedValue
  14.      * @ORM\Column(type="integer")
  15.      */
  16.     private $id;
  17.     /**
  18.      * @ORM\Column(type="string", length=255)
  19.      */
  20.     private $title;
  21.     /**
  22.      * @ORM\Column(type="text")
  23.      */
  24.     private $content;
  25.     /**
  26.      * @ORM\Column(type="string", length=32, options={"default":"v1.0"})
  27.      */
  28.     private string $version 'v1.0';
  29.     /**
  30.      * @ORM\Column(type="datetime_immutable")
  31.      */
  32.     private DateTimeImmutable $createdAt;
  33.     /**
  34.      * @ORM\Column(type="datetime_immutable", nullable=true)
  35.      */
  36.     private ?DateTimeImmutable $updatedAt null;
  37.     public function __construct()
  38.     {
  39.         $this->createdAt = new DateTimeImmutable();
  40.     }
  41.     public function getId(): ?int
  42.     {
  43.         return $this->id;
  44.     }
  45.     public function getTitle(): ?string
  46.     {
  47.         return $this->title;
  48.     }
  49.     public function setTitle(string $title): self
  50.     {
  51.         $this->title $title;
  52.         return $this;
  53.     }
  54.     public function getContent(): ?string
  55.     {
  56.         return $this->content;
  57.     }
  58.     public function setContent(string $content): self
  59.     {
  60.         $this->content $content;
  61.         return $this;
  62.     }
  63.     public function getVersion(): string
  64.     {
  65.         return $this->version;
  66.     }
  67.     public function setVersion(string $version): self
  68.     {
  69.         $this->version $version;
  70.         return $this;
  71.     }
  72.     public function getCreatedAt(): DateTimeImmutable
  73.     {
  74.         return $this->createdAt;
  75.     }
  76.     public function setCreatedAt(DateTimeImmutable $createdAt): self
  77.     {
  78.         $this->createdAt $createdAt;
  79.         return $this;
  80.     }
  81.     public function getUpdatedAt(): ?DateTimeImmutable
  82.     {
  83.         return $this->updatedAt;
  84.     }
  85.     public function setUpdatedAt(?DateTimeImmutable $updatedAt): self
  86.     {
  87.         $this->updatedAt $updatedAt;
  88.         return $this;
  89.     }
  90. }