src/Admin/Entity/StdRedirects.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Admin\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * StdRedirects
  6.  */
  7. #[ORM\Table(name'std_redirects')]
  8. #[ORM\Entity(repositoryClass'App\Admin\Repository\StdRedirectsRepository')]
  9. #[ORM\UniqueConstraint(name'urlorigin_idx'columns: ['url_origin'])]
  10. #[ORM\HasLifecycleCallbacks]
  11. class StdRedirects
  12. {
  13.     /**
  14.      * @var int
  15.      */
  16.     #[ORM\Column(name'id'type'integer'nullablefalseoptions: ['unsigned' => true'comment' => 'Rule unique identifier'])]
  17.     #[ORM\Id]
  18.     #[ORM\GeneratedValue(strategy'IDENTITY')]
  19.     private $id;
  20.     /**
  21.      * @var string
  22.      */
  23.     #[ORM\Column(name'url_origin'type'string'length500nullablefalseoptions: ['comment' => 'Original URL to redirect from'])]
  24.     private $urlOrigin;
  25.     /**
  26.      * @var string
  27.      */
  28.     #[ORM\Column(name'url_destination'type'string'length500nullablefalseoptions: ['comment' => 'Destination URL to redirect to'])]
  29.     private $urlDestination;
  30.     /**
  31.      * @var int
  32.      */
  33.     #[ORM\Column(name'code'type'integer'nullablefalseoptions: ['default' => 301'comment' => 'Type of redirect - status code'])]
  34.     private $code=301;
  35.     /**
  36.      * @var int
  37.      */
  38.     #[ORM\Column(name'priority'type'integer'nullablefalseoptions: ['default' => 1'comment' => 'Rule priority'])]
  39.     private $priority=1;
  40.     /**
  41.      * @var bool
  42.      */
  43.     #[ORM\Column(name'is_active'type'boolean'nullablefalseoptions: ['default' => 1'comment' => 'Flag that indicates if the rule is active'])]
  44.     private $isActive '1';
  45.     /**
  46.      * @var \DateTime
  47.      */
  48.     #[ORM\Column(name'created_date'type'datetime'nullablefalseoptions: ['comment' => 'Date and time of the record creation'])]
  49.     private $createdDate;
  50.     /**
  51.      * @var \DateTime
  52.      */
  53.     #[ORM\Column(name'updated_date'type'datetime'nullablefalseoptions: ['comment' => 'Date and time the record was last updated'])]
  54.     private $updatedDate;
  55.     /**
  56.      * @var \StdUsers
  57.      */
  58.     #[ORM\JoinColumn(name'created_by'referencedColumnName'id')]
  59.     #[ORM\ManyToOne(targetEntity'StdUsers')]
  60.     private $createdBy;
  61.     /**
  62.      * @var \StdUsers
  63.      */
  64.     #[ORM\JoinColumn(name'updated_by'referencedColumnName'id')]
  65.     #[ORM\ManyToOne(targetEntity'StdUsers')]
  66.     private $updatedBy;
  67.     public function getId(): ?int
  68.     {
  69.         return $this->id;
  70.     }
  71.     public function getUrlOrigin(): ?string
  72.     {
  73.         return $this->urlOrigin;
  74.     }
  75.     public function setUrlOrigin(string $urlOrigin): self
  76.     {
  77.         $this->urlOrigin=$urlOrigin;
  78.         return $this;
  79.     }
  80.     public function getUrlDestination(): ?string
  81.     {
  82.         return $this->urlDestination;
  83.     }
  84.     public function setUrlDestination(string $urlDestination): self
  85.     {
  86.         $this->urlDestination $urlDestination;
  87.         return $this;
  88.     }
  89.     public function getCode(): ?int
  90.     {
  91.         return $this->code;
  92.     }
  93.     public function setCode(int $code): self
  94.     {
  95.         $this->code=$code;
  96.         return $this;
  97.     }
  98.     public function getPriority(): ?int
  99.     {
  100.         return $this->priority;
  101.     }
  102.     public function setPriority(int $priority): self
  103.     {
  104.         $this->priority=$priority;
  105.         return $this;
  106.     }
  107.     public function getIsActive(): ?bool
  108.     {
  109.         return $this->isActive;
  110.     }
  111.     public function setIsActive(bool $isActive): self
  112.     {
  113.         $this->isActive $isActive;
  114.         return $this;
  115.     }
  116.     public function getCreatedDate(): ?\DateTimeInterface
  117.     {
  118.         return $this->createdDate;
  119.     }
  120.     public function setCreatedDate(\DateTimeInterface $createdDate): self
  121.     {
  122.         $this->createdDate $createdDate;
  123.         return $this;
  124.     }
  125.     public function getUpdatedDate(): ?\DateTimeInterface
  126.     {
  127.         return $this->updatedDate;
  128.     }
  129.     public function setUpdatedDate(\DateTimeInterface $updatedDate): self
  130.     {
  131.         $this->updatedDate $updatedDate;
  132.         return $this;
  133.     }
  134.     public function getCreatedBy(): ?StdUsers
  135.     {
  136.         return $this->createdBy;
  137.     }
  138.     public function setCreatedBy(?StdUsers $createdBy): self
  139.     {
  140.         $this->createdBy $createdBy;
  141.         return $this;
  142.     }
  143.     public function getUpdatedBy(): ?StdUsers
  144.     {
  145.         return $this->updatedBy;
  146.     }
  147.     public function setUpdatedBy(?StdUsers $updatedBy): self
  148.     {
  149.         $this->updatedBy $updatedBy;
  150.         return $this;
  151.     }
  152.      #[ORM\PreUpdate]
  153.     public function setUpdated()
  154.     {
  155.         $this->setUpdatedDate(new \DateTime());
  156.     }
  157.     #[ORM\PrePersist]
  158.     public function setCreated()
  159.     {
  160.         $this->setUpdatedDate(new \DateTime());
  161.         $this->setCreatedDate(new \DateTime());
  162.     }
  163. }