src/Entity/Meta.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Constants\PageTypeConstant;
  4. use App\Traits\MetaImageTrait as MetaImage;
  5. use App\Traits\MetaTrait;
  6. use App\Traits\TimeTrackTrait as TimeTrack;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Gedmo\Mapping\Annotation as Gedmo;
  9. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  10. #[UniqueEntity('type')]
  11. #[ORM\HasLifecycleCallbacks]
  12. #[ORM\Entity(repositoryClass\App\Repository\MetaRepository::class)]
  13. #[ORM\Table(name'meta')]
  14. class Meta
  15. {
  16.     use MetaImage;
  17.     use TimeTrack;
  18.     use MetaTrait;
  19.     /**
  20.      * @var int
  21.      */
  22.     #[ORM\Column(name'id'type'integer')]
  23.     #[ORM\Id]
  24.     #[ORM\GeneratedValue(strategy'AUTO')]
  25.     private $id;
  26.     /**
  27.      * @var string
  28.      */
  29.     #[ORM\Column(name'type'type'string'length191uniquetrue)]
  30.     private $type;
  31.     #[ORM\Column(name'position'type'integer'nullabletrueoptions: ['unsigned' => true])]
  32.     #[Gedmo\SortablePosition]
  33.     private ?int $position 1;
  34.     /**
  35.      * @var string
  36.      */
  37.     #[ORM\Column(name'title'type'string'length191)]
  38.     private $title;
  39.     /**
  40.      * @var string
  41.      */
  42.     #[ORM\Column(name'sirTrevorContent'type'text'nullabletrue)]
  43.     protected $sirTrevorContent;
  44.     #[ORM\Column(name'content'type'text'nullabletrue)]
  45.     protected ?string $content null;
  46.     /**
  47.      * Get id.
  48.      *
  49.      * @return int
  50.      */
  51.     public function getId()
  52.     {
  53.         return $this->id;
  54.     }
  55.     /**
  56.      * Set type.
  57.      *
  58.      * @param string $type
  59.      *
  60.      * @return Meta
  61.      */
  62.     public function setType($type): static
  63.     {
  64.         $this->type $type;
  65.         return $this;
  66.     }
  67.     /**
  68.      * Get type.
  69.      *
  70.      * @return string
  71.      */
  72.     public function getType()
  73.     {
  74.         return $this->type;
  75.     }
  76.     public function getTypeLabel(): string
  77.     {
  78.         $types PageTypeConstant::loadPageTypes();
  79.         return $types[$this->type] ?? $this->type;
  80.     }
  81.     public function getPosition(): ?int
  82.     {
  83.         return $this->position;
  84.     }
  85.     public function setPosition(?int $position): static
  86.     {
  87.         $this->position $position;
  88.         return $this;
  89.     }
  90.     public function getTitle(): ?string
  91.     {
  92.         return $this->title;
  93.     }
  94.     public function setTitle(string $title): static
  95.     {
  96.         $this->title $title;
  97.         return $this;
  98.     }
  99.     public function getSirTrevorContent(): ?string
  100.     {
  101.         return $this->sirTrevorContent;
  102.     }
  103.     public function setSirTrevorContent(?string $sirTrevorContent): static
  104.     {
  105.         $this->sirTrevorContent $sirTrevorContent;
  106.         return $this;
  107.     }
  108.     public function getContent(): ?string
  109.     {
  110.         return $this->content;
  111.     }
  112.     public function setContent(?string $content): static
  113.     {
  114.         $this->content $content;
  115.         return $this;
  116.     }
  117.     public function getMetaTitle()
  118.     {
  119.         return $this->metaTitle;
  120.     }
  121.     public function getMetaDescription()
  122.     {
  123.         return $this->metaDescription;
  124.     }
  125.     public function getMetaKeywords()
  126.     {
  127.         return $this->metaKeywords;
  128.     }
  129.     public function getMetaCanonical()
  130.     {
  131.         return $this->metaCanonical;
  132.     }
  133.     /**
  134.      * Set createdAt.
  135.      *
  136.      * @param \DateTime|null $createdAt
  137.      *
  138.      * @return Meta
  139.      */
  140.     public function setCreatedAt($createdAt null)
  141.     {
  142.         $this->createdAt $createdAt;
  143.         return $this;
  144.     }
  145.     /**
  146.      * Get createdAt.
  147.      *
  148.      * @return \DateTime|null
  149.      */
  150.     public function getCreatedAt()
  151.     {
  152.         return $this->createdAt;
  153.     }
  154.     /**
  155.      * Set updatedAt.
  156.      *
  157.      * @param \DateTime|null $updatedAt
  158.      *
  159.      * @return Meta
  160.      */
  161.     public function setUpdatedAt($updatedAt null)
  162.     {
  163.         $this->updatedAt $updatedAt;
  164.         return $this;
  165.     }
  166.     /**
  167.      * Get updatedAt.
  168.      *
  169.      * @return \DateTime|null
  170.      */
  171.     public function getUpdatedAt()
  172.     {
  173.         return $this->updatedAt;
  174.     }
  175.     public function getMetaImage(): ?SonataMediaMedia
  176.     {
  177.         return $this->meta_image;
  178.     }
  179.     public function setMetaImage(?SonataMediaMedia $meta_image): static
  180.     {
  181.         $this->meta_image $meta_image;
  182.         return $this;
  183.     }
  184.     public function setMetaTitle($metaTitle)
  185.     {
  186.         $this->metaTitle $metaTitle;
  187.         return $this;
  188.     }
  189.     public function setMetaDescription($metaDescription)
  190.     {
  191.         $this->metaDescription $metaDescription;
  192.         return $this;
  193.     }
  194.     public function setMetaKeywords($metaKeywords)
  195.     {
  196.         $this->metaKeywords $metaKeywords;
  197.         return $this;
  198.     }
  199.     public function setMetaCanonical($metaCanonical)
  200.     {
  201.         $this->metaCanonical $metaCanonical;
  202.         return $this;
  203.     }
  204. }