<?php
namespace App\Admin\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* StdRedirects
*/
#[ORM\Table(name: 'std_redirects')]
#[ORM\Entity(repositoryClass: 'App\Admin\Repository\StdRedirectsRepository')]
#[ORM\UniqueConstraint(name: 'urlorigin_idx', columns: ['url_origin'])]
#[ORM\HasLifecycleCallbacks]
class StdRedirects
{
/**
* @var int
*/
#[ORM\Column(name: 'id', type: 'integer', nullable: false, options: ['unsigned' => true, 'comment' => 'Rule unique identifier'])]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
private $id;
/**
* @var string
*/
#[ORM\Column(name: 'url_origin', type: 'string', length: 500, nullable: false, options: ['comment' => 'Original URL to redirect from'])]
private $urlOrigin;
/**
* @var string
*/
#[ORM\Column(name: 'url_destination', type: 'string', length: 500, nullable: false, options: ['comment' => 'Destination URL to redirect to'])]
private $urlDestination;
/**
* @var int
*/
#[ORM\Column(name: 'code', type: 'integer', nullable: false, options: ['default' => 301, 'comment' => 'Type of redirect - status code'])]
private $code=301;
/**
* @var int
*/
#[ORM\Column(name: 'priority', type: 'integer', nullable: false, options: ['default' => 1, 'comment' => 'Rule priority'])]
private $priority=1;
/**
* @var bool
*/
#[ORM\Column(name: 'is_active', type: 'boolean', nullable: false, options: ['default' => 1, 'comment' => 'Flag that indicates if the rule is active'])]
private $isActive = '1';
/**
* @var \DateTime
*/
#[ORM\Column(name: 'created_date', type: 'datetime', nullable: false, options: ['comment' => 'Date and time of the record creation'])]
private $createdDate;
/**
* @var \DateTime
*/
#[ORM\Column(name: 'updated_date', type: 'datetime', nullable: false, options: ['comment' => 'Date and time the record was last updated'])]
private $updatedDate;
/**
* @var \StdUsers
*/
#[ORM\JoinColumn(name: 'created_by', referencedColumnName: 'id')]
#[ORM\ManyToOne(targetEntity: 'StdUsers')]
private $createdBy;
/**
* @var \StdUsers
*/
#[ORM\JoinColumn(name: 'updated_by', referencedColumnName: 'id')]
#[ORM\ManyToOne(targetEntity: 'StdUsers')]
private $updatedBy;
public function getId(): ?int
{
return $this->id;
}
public function getUrlOrigin(): ?string
{
return $this->urlOrigin;
}
public function setUrlOrigin(string $urlOrigin): self
{
$this->urlOrigin=$urlOrigin;
return $this;
}
public function getUrlDestination(): ?string
{
return $this->urlDestination;
}
public function setUrlDestination(string $urlDestination): self
{
$this->urlDestination = $urlDestination;
return $this;
}
public function getCode(): ?int
{
return $this->code;
}
public function setCode(int $code): self
{
$this->code=$code;
return $this;
}
public function getPriority(): ?int
{
return $this->priority;
}
public function setPriority(int $priority): self
{
$this->priority=$priority;
return $this;
}
public function getIsActive(): ?bool
{
return $this->isActive;
}
public function setIsActive(bool $isActive): self
{
$this->isActive = $isActive;
return $this;
}
public function getCreatedDate(): ?\DateTimeInterface
{
return $this->createdDate;
}
public function setCreatedDate(\DateTimeInterface $createdDate): self
{
$this->createdDate = $createdDate;
return $this;
}
public function getUpdatedDate(): ?\DateTimeInterface
{
return $this->updatedDate;
}
public function setUpdatedDate(\DateTimeInterface $updatedDate): self
{
$this->updatedDate = $updatedDate;
return $this;
}
public function getCreatedBy(): ?StdUsers
{
return $this->createdBy;
}
public function setCreatedBy(?StdUsers $createdBy): self
{
$this->createdBy = $createdBy;
return $this;
}
public function getUpdatedBy(): ?StdUsers
{
return $this->updatedBy;
}
public function setUpdatedBy(?StdUsers $updatedBy): self
{
$this->updatedBy = $updatedBy;
return $this;
}
#[ORM\PreUpdate]
public function setUpdated()
{
$this->setUpdatedDate(new \DateTime());
}
#[ORM\PrePersist]
public function setCreated()
{
$this->setUpdatedDate(new \DateTime());
$this->setCreatedDate(new \DateTime());
}
}