src/Entity/System/CoreUrlRewrite.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\System;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * CoreUrlRewrite
  7.  *
  8.  * @ORM\Table(name="core_url_rewrite")
  9.  *
  10.  * @ORM\Entity(repositoryClass="App\Repository\System\CoreUrlRewriteRepository")
  11.  */
  12. class CoreUrlRewrite
  13. {
  14.     public const TARGET_PATH_PRODUCT 'product/view/';
  15.     public const TARGET_PATH_MANUFACTURER 'manufacturer/view/';
  16.     public const TARGET_PATH_TAXONOMY 'taxonomy/view/';
  17.     /**
  18.      * @var int
  19.      *
  20.      * @ORM\Column(name="url_rewrite_id", type="integer")
  21.      *
  22.      * @ORM\Id
  23.      *
  24.      * @ORM\GeneratedValue(strategy="AUTO")
  25.      */
  26.     private $id;
  27.     /**
  28.      * @var string
  29.      *
  30.      * @ORM\Column(name="request_path", type="string", length=255, nullable=true)
  31.      */
  32.     private $requestPath;
  33.     /**
  34.      * @var string
  35.      *
  36.      * @ORM\Column(name="target_path", type="string", length=255, nullable=true)
  37.      */
  38.     private $targetPath;
  39.     /**
  40.      * @var Product|null
  41.      *
  42.      * @ORM\ManyToOne(targetEntity="App\Entity\System\Product", inversedBy="coreUrlRewrites")
  43.      *
  44.      * @ORM\JoinColumn(name="product_id", nullable=true, referencedColumnName="id_product")
  45.      */
  46.     private $product;
  47.     /**
  48.      * @var Language|null
  49.      *
  50.      * @ORM\ManyToOne(targetEntity="App\Entity\System\Language")
  51.      *
  52.      * @ORM\JoinColumn(name="id_lang", nullable=true, referencedColumnName="id_lang")
  53.      */
  54.     private $language;
  55.     /**
  56.      * @var CoreUrlRewrite|null
  57.      *
  58.      * @ORM\ManyToOne(targetEntity="App\Entity\System\CoreUrlRewrite", inversedBy="redirectedFrom")
  59.      *
  60.      * @ORM\JoinColumn(nullable=true, name="id_core_url_rewrite_redirect", referencedColumnName="url_rewrite_id")
  61.      */
  62.     private $redirectsTo;
  63.     /**
  64.      * @var CoreUrlRewrite[]|ArrayCollection
  65.      *
  66.      * @ORM\OneToMany(targetEntity="App\Entity\System\CoreUrlRewrite", mappedBy="redirectsTo")
  67.      */
  68.     private $redirectedFrom;
  69.     /**
  70.      * @var Category|null
  71.      *
  72.      * @ORM\ManyToOne(targetEntity="App\Entity\System\Category")
  73.      *
  74.      * @ORM\JoinColumn(name="category_id", nullable=true, referencedColumnName="id_category")
  75.      */
  76.     private $category;
  77.     /**
  78.      * @var Taxonomy|null
  79.      *
  80.      * @ORM\ManyToOne(targetEntity="App\Entity\System\Taxonomy")
  81.      *
  82.      * @ORM\JoinColumn(name="taxonomy_id", nullable=true, referencedColumnName="id")
  83.      */
  84.     private $taxonomy;
  85.     /**
  86.      * @return int
  87.      */
  88.     public function getId(): int
  89.     {
  90.         return $this->id;
  91.     }
  92.     /**
  93.      * @return string
  94.      */
  95.     public function getRequestPath(): string
  96.     {
  97.         return $this->requestPath;
  98.     }
  99.     /**
  100.      * @param string $requestPath
  101.      *
  102.      * @return CoreUrlRewrite
  103.      */
  104.     public function setRequestPath(string $requestPath): CoreUrlRewrite
  105.     {
  106.         $this->requestPath $requestPath;
  107.         return $this;
  108.     }
  109.     /**
  110.      * @return string
  111.      */
  112.     public function getTargetPath(): string
  113.     {
  114.         return $this->targetPath;
  115.     }
  116.     /**
  117.      * @param string $targetPath
  118.      *
  119.      * @return CoreUrlRewrite
  120.      */
  121.     public function setTargetPath(string $targetPath): CoreUrlRewrite
  122.     {
  123.         $this->targetPath $targetPath;
  124.         return $this;
  125.     }
  126.     /**
  127.      * @return Product|null
  128.      */
  129.     public function getProduct(): ?Product
  130.     {
  131.         return $this->product;
  132.     }
  133.     /**
  134.      * @param Product|null $product
  135.      *
  136.      * @return CoreUrlRewrite
  137.      */
  138.     public function setProduct(?Product $product): CoreUrlRewrite
  139.     {
  140.         $this->product $product;
  141.         return $this;
  142.     }
  143.     /**
  144.      * @return Language|null
  145.      */
  146.     public function getLanguage(): ?Language
  147.     {
  148.         return $this->language;
  149.     }
  150.     /**
  151.      * @param Language|null $language
  152.      *
  153.      * @return CoreUrlRewrite
  154.      */
  155.     public function setLanguage(?Language $language): CoreUrlRewrite
  156.     {
  157.         $this->language $language;
  158.         return $this;
  159.     }
  160.     /**
  161.      * @return CoreUrlRewrite|null
  162.      */
  163.     public function getRedirectsTo(): ?CoreUrlRewrite
  164.     {
  165.         return $this->redirectsTo;
  166.     }
  167.     /**
  168.      * @param CoreUrlRewrite|null $redirectsTo
  169.      *
  170.      * @return CoreUrlRewrite
  171.      */
  172.     public function setRedirectsTo(?CoreUrlRewrite $redirectsTo): CoreUrlRewrite
  173.     {
  174.         $this->redirectsTo $redirectsTo;
  175.         return $this;
  176.     }
  177.     /**
  178.      * @return CoreUrlRewrite[]|ArrayCollection
  179.      */
  180.     public function getRedirectedFrom()
  181.     {
  182.         return $this->redirectedFrom;
  183.     }
  184.     /**
  185.      * @param CoreUrlRewrite[]|ArrayCollection $redirectedFrom
  186.      *
  187.      * @return CoreUrlRewrite
  188.      */
  189.     public function setRedirectedFrom($redirectedFrom): CoreUrlRewrite
  190.     {
  191.         $this->redirectedFrom $redirectedFrom;
  192.         return $this;
  193.     }
  194.     /**
  195.      * @return Category|null
  196.      */
  197.     public function getCategory(): ?Category
  198.     {
  199.         return $this->category;
  200.     }
  201.     /**
  202.      * @param Category|null $category
  203.      *
  204.      * @return CoreUrlRewrite
  205.      */
  206.     public function setCategory(?Category $category): CoreUrlRewrite
  207.     {
  208.         $this->category $category;
  209.         return $this;
  210.     }
  211.     /**
  212.      * @return Taxonomy|null
  213.      */
  214.     public function getTaxonomy(): ?Taxonomy
  215.     {
  216.         return $this->taxonomy;
  217.     }
  218.     /**
  219.      * @param Taxonomy|null $taxonomy
  220.      *
  221.      * @return CoreUrlRewrite
  222.      */
  223.     public function setTaxonomy(?Taxonomy $taxonomy): CoreUrlRewrite
  224.     {
  225.         $this->taxonomy $taxonomy;
  226.         return $this;
  227.     }
  228.     public function __construct()
  229.     {
  230.         $this->redirectedFrom = new ArrayCollection();
  231.     }
  232. }