vendor/tmwk/url-redirect/Entity/Redirect.php line 27

Open in your IDE?
  1. <?php
  2. /*
  3.  * ************************************************************************
  4.  *  * Nombre del Archivo: Redirect.php
  5.  *  * Autor: Mario Figueroa [mfigueroa@tmwk.cl]
  6.  *  * Fecha de Creación: 2/8/23 14:42
  7.  *  ***********************************************************************
  8.  *  * Copyright (c) 2023 Mario Figueroa
  9.  *  * Queda prohibida la distribución y uso no autorizado de este archivo.
  10.  *  * Para obtener más detalles, consulta el archivo LICENSE.md
  11.  *  ***********************************************************************
  12.  */
  13. namespace TMWK\RedirectBundle\Entity;
  14. use DateTime;
  15. use Doctrine\DBAL\Types\Types;
  16. use Doctrine\ORM\Mapping as ORM;
  17. use Symfony\Component\Validator\Constraints as Assert;
  18. use Gedmo\Mapping\Annotation as Gedmo;
  19. /**
  20.  * @ORM\Entity
  21.  * @ORM\Table(name="redirect")
  22.  */
  23. class Redirect
  24. {
  25.     /**
  26.      * @ORM\Id
  27.      * @ORM\Column(type="integer")
  28.      * @ORM\GeneratedValue(strategy="AUTO")
  29.      */
  30.     protected $id;
  31.     /**
  32.      * @Assert\NotBlank(message="El campo no puede quedar vacio")
  33.      * @var string $url_old
  34.      *
  35.      * @ORM\Column(type="string", nullable=true)
  36.      */
  37.     protected $url_old;
  38.     /**
  39.      * @Assert\NotBlank(message="El campo no puede quedar vacio")
  40.      * @var string $url_new
  41.      *
  42.      * @ORM\Column(type="string", nullable=true)
  43.      */
  44.     protected $url_new;
  45.     /**
  46.      * @Gedmo\SortablePosition
  47.      * @var string $position
  48.      *
  49.      * @ORM\Column(type="integer", nullable=true)
  50.      */
  51.     protected $position;
  52.     /**
  53.     * @var DateTime $create_at
  54.     *
  55.     * @Gedmo\Timestampable(on="create")
  56.     * @ORM\Column(type="datetime", nullable=true)
  57.     */
  58.     protected $create_at;
  59.     /**
  60.     * @var DateTime $update_at
  61.     *
  62.     * @Gedmo\Timestampable(on="update")
  63.     * @ORM\Column(type="datetime", nullable=true)
  64.     */
  65.     protected $update_at;
  66.     public function __toString()
  67.     {
  68.         return $this->getUrlOld();
  69.     }
  70.     public function getId(): ?int
  71.     {
  72.         return $this->id;
  73.     }
  74.     public function getUrlOld(): ?string
  75.     {
  76.         return $this->url_old;
  77.     }
  78.     public function setUrlOld(?string $url_old): static
  79.     {
  80.         $this->url_old $url_old;
  81.         return $this;
  82.     }
  83.     public function getUrlNew(): ?string
  84.     {
  85.         return $this->url_new;
  86.     }
  87.     public function setUrlNew(?string $url_new): static
  88.     {
  89.         $this->url_new $url_new;
  90.         return $this;
  91.     }
  92.     public function getPosition(): ?int
  93.     {
  94.         return $this->position;
  95.     }
  96.     public function setPosition(?int $position): static
  97.     {
  98.         $this->position $position;
  99.         return $this;
  100.     }
  101.     public function getCreateAt(): ?\DateTimeInterface
  102.     {
  103.         return $this->create_at;
  104.     }
  105.     public function setCreateAt(?\DateTimeInterface $create_at): static
  106.     {
  107.         $this->create_at $create_at;
  108.         return $this;
  109.     }
  110.     public function getUpdateAt(): ?\DateTimeInterface
  111.     {
  112.         return $this->update_at;
  113.     }
  114.     public function setUpdateAt(?\DateTimeInterface $update_at): static
  115.     {
  116.         $this->update_at $update_at;
  117.         return $this;
  118.     }
  119. }