src/Entity/LandingPage.php line 31

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Knp\DoctrineBehaviors\Contract\Entity\SoftDeletableInterface;
  4. use Knp\DoctrineBehaviors\Model\SoftDeletable\SoftDeletableTrait;
  5. use Knp\DoctrineBehaviors\Model\Blameable\BlameableTrait;
  6. use Knp\DoctrineBehaviors\Contract\Entity\BlameableInterface;
  7. use Knp\DoctrineBehaviors\Model\Timestampable\TimestampableTrait;
  8. use Knp\DoctrineBehaviors\Contract\Entity\TimestampableInterface;
  9. use Doctrine\Common\Collections\ArrayCollection;
  10. use Doctrine\Common\Collections\Collection;
  11. use Doctrine\ORM\Mapping as ORM;
  12. use Symfony\Component\Validator\Constraints as Assert;
  13. use Symfony\Component\HttpFoundation\File\UploadedFile;
  14. use Symfony\Component\HttpFoundation\File\File;
  15. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  16. use Symfony\Contracts\Translation\TranslatorInterface;
  17. /**
  18.  * @ORM\Entity
  19.  * @ORM\Table(name="landing_page")
  20.  */
  21. class LandingPage implements BlameableInterfaceTimestampableInterfaceSoftDeletableInterface  {
  22.     use BlameableTrait;
  23.     use TimestampableTrait;
  24.     
  25.     use SoftDeletableTrait;
  26.     
  27. const LP_STREFA_OKAZJI 228;
  28.     
  29.     
  30.     /**
  31.      * @ORM\Id
  32.      * @ORM\Column(type="integer")
  33.      * @ORM\GeneratedValue(strategy="AUTO")
  34.      */
  35.     protected $id;
  36.     /**
  37.      * @var string
  38.      *
  39.      * @ORM\Column(name="name", type="string", length=255, nullable=true)
  40.      */
  41.     private $name;
  42.     /**
  43.      * @var string
  44.      *
  45.      * @ORM\Column(name="header", type="string", length=255, nullable=true)
  46.      */
  47.     private $header;
  48.     /**
  49.      * @var string
  50.      *
  51.      * @ORM\Column(name="description", type="text", nullable=true)
  52.      */
  53.     private $description;
  54.     /**
  55.      * @Doctrine\ORM\Mapping\Column(type="boolean", nullable=true)
  56.      */
  57.     protected $visible true;
  58.     /**
  59.      * @Doctrine\ORM\Mapping\Column(name="special_for_buy_cheaper", type="boolean", nullable=true)
  60.      */
  61.     protected $specialForBuyCheaper false;
  62.     /**
  63.      * @var string
  64.      *
  65.      * @ORM\Column(name="slug", type="string", length=255, nullable=true)
  66.      */
  67.     private $slug;
  68.     /**
  69.      * @var string
  70.      *
  71.      * @ORM\Column(name="redirect", type="string", length=255, nullable=true)
  72.      */
  73.     private $redirect;
  74.     /**
  75.      * @ORM\ManyToOne(targetEntity="App\Entity\TopBanner")
  76.      * @ORM\JoinColumn(name="top_banner_id", referencedColumnName="id")
  77.      */
  78.     protected $topBanner;
  79.     /**
  80.      * @ORM\ManyToOne(targetEntity="App\Entity\Language")
  81.      * @ORM\JoinColumn(name="language_id", referencedColumnName="id")
  82.      */
  83.     protected $language;
  84.     /**
  85.      * @ORM\ManyToOne(targetEntity="App\Entity\ProductProducer")
  86.      * @ORM\JoinColumn(name="product_producer_id", referencedColumnName="id")
  87.      */
  88.     protected $productProducer;
  89.     /**
  90.      * @ORM\ManyToOne(targetEntity="App\Entity\Banners")
  91.      * @ORM\JoinColumn(name="banner_id", referencedColumnName="id")
  92.      */
  93.     protected $banner;
  94.     /**
  95.      * @Doctrine\ORM\Mapping\ManyToMany(targetEntity="App\Entity\Product", inversedBy="landingPages")
  96.      * @Doctrine\ORM\Mapping\JoinTable(name="landing_page_products")
  97.      * @Doctrine\ORM\Mapping\OrderBy({"prioritySearchEngine" = "ASC"})
  98.      */
  99.     private $products;
  100.     /**
  101.      * @Doctrine\ORM\Mapping\OneToMany(targetEntity="App\Entity\Marker", mappedBy="landingPage", cascade={"persist"})
  102.      */
  103.     protected $markers;
  104.     /**
  105.      * @Doctrine\ORM\Mapping\OneToMany(targetEntity="App\Entity\ListingMarker", mappedBy="landingPage", cascade={"persist"})
  106.      */
  107.     protected $listingMarkers;
  108.     /**
  109.      * @var string
  110.      *
  111.      * @ORM\Column(name="meta_title", type="string", nullable=true)
  112.      */
  113.     private $metaTitle;
  114.     /**
  115.      * @var string
  116.      *
  117.      * @ORM\Column(name="meta_description", type="string", nullable=true)
  118.      */
  119.     private $metaDescription;
  120.     /**
  121.      * @return string
  122.      */
  123.     public function getHeader()
  124.     {
  125.         return $this->header;
  126.     }
  127.     /**
  128.      * @param string $header
  129.      */
  130.     public function setHeader($header)
  131.     {
  132.         $this->header $header;
  133.     }
  134.     public function __construct()
  135.     {
  136.         $this->products = new ArrayCollection();
  137.         $this->markers = new ArrayCollection();
  138.         $this->listingMarkers = new ArrayCollection();
  139.     }
  140.     
  141.     public function getId(): ?int
  142.     {
  143.         return $this->id;
  144.     }
  145.     public function getName(): ?string
  146.     {
  147.         return $this->name;
  148.     }
  149.     public function setName(?string $name): self
  150.     {
  151.         $this->name $name;
  152.         return $this;
  153.     }
  154.     public function getDescription(): ?string
  155.     {
  156.         return $this->description;
  157.     }
  158.     public function setDescription(?string $description): self
  159.     {
  160.         $this->description $description;
  161.         return $this;
  162.     }
  163.     public function getVisible(): ?bool
  164.     {
  165.         return $this->visible;
  166.     }
  167.     public function setVisible(?bool $visible): self
  168.     {
  169.         $this->visible $visible;
  170.         return $this;
  171.     }
  172.     public function getSlug(): ?string
  173.     {
  174.         return $this->slug;
  175.     }
  176.     public function setSlug(?string $slug): self
  177.     {
  178.         $this->slug $slug;
  179.         return $this;
  180.     }
  181.     public function getLanguage(): ?Language
  182.     {
  183.         return $this->language;
  184.     }
  185.     public function setLanguage(?Language $language): self
  186.     {
  187.         $this->language $language;
  188.         return $this;
  189.     }
  190.     /**
  191.      * @return Collection|Product[]
  192.      */
  193.     public function getProducts(): Collection
  194.     {
  195.         return $this->products;
  196.     }
  197.     public function addProduct(Product $product): self
  198.     {
  199.         if (!$this->products->contains($product)) {
  200.             $this->products[] = $product;
  201.         }
  202.         return $this;
  203.     }
  204.     public function removeProduct(Product $product): self
  205.     {
  206.         if ($this->products->contains($product)) {
  207.             $this->products->removeElement($product);
  208.         }
  209.         return $this;
  210.     }
  211.     public function getBanner(): ?Banners
  212.     {
  213.         return $this->banner;
  214.     }
  215.     public function setBanner(?Banners $banner): self
  216.     {
  217.         $this->banner $banner;
  218.         return $this;
  219.     }
  220.     /**
  221.      * @return Collection|Marker[]
  222.      */
  223.     public function getMarkers(): Collection
  224.     {
  225.         return $this->markers;
  226.     }
  227.     public function addMarker(Marker $marker): self
  228.     {
  229.         if (!$this->markers->contains($marker)) {
  230.             $this->markers[] = $marker;
  231.             $marker->setLandingPage($this);
  232.         }
  233.         return $this;
  234.     }
  235.     public function removeMarker(Marker $marker): self
  236.     {
  237.         if ($this->markers->contains($marker)) {
  238.             $this->markers->removeElement($marker);
  239.             // set the owning side to null (unless already changed)
  240.             if ($marker->getLandingPage() === $this) {
  241.                 $marker->setLandingPage(null);
  242.             }
  243.         }
  244.         return $this;
  245.     }
  246.     public function getTopBanner(): ?TopBanner
  247.     {
  248.         return $this->topBanner;
  249.     }
  250.     public function setTopBanner(?TopBanner $topBanner): self
  251.     {
  252.         $this->topBanner $topBanner;
  253.         return $this;
  254.     }
  255.     /**
  256.      * @return string
  257.      */
  258.     public function getRedirect()
  259.     {
  260.         return $this->redirect;
  261.     }
  262.     /**
  263.      * @param string $redirect
  264.      */
  265.     public function setRedirect($redirect)
  266.     {
  267.         $this->redirect $redirect;
  268.     }
  269.     /**
  270.      * @return string
  271.      */
  272.     public function getMetaTitle()
  273.     {
  274.         return $this->metaTitle;
  275.     }
  276.     /**
  277.      * @param string $metaTitle
  278.      */
  279.     public function setMetaTitle($metaTitle)
  280.     {
  281.         $this->metaTitle $metaTitle;
  282.     }
  283.     /**
  284.      * @return string
  285.      */
  286.     public function getMetaDescription()
  287.     {
  288.         return $this->metaDescription;
  289.     }
  290.     /**
  291.      * @param string $metaDescription
  292.      */
  293.     public function setMetaDescription($metaDescription)
  294.     {
  295.         $this->metaDescription $metaDescription;
  296.     }
  297.     /**
  298.      * @return mixed
  299.      */
  300.     public function getProductProducer()
  301.     {
  302.         return $this->productProducer;
  303.     }
  304.     /**
  305.      * @param mixed $productProducer
  306.      */
  307.     public function setProductProducer($productProducer)
  308.     {
  309.         $this->productProducer $productProducer;
  310.     }
  311.     /**
  312.      * @return Collection|ListingMarker[]
  313.      */
  314.     public function getListingMarkers(): Collection
  315.     {
  316.         return $this->listingMarkers;
  317.     }
  318.     public function addListingMarker(ListingMarker $listingMarker): self
  319.     {
  320.         if (!$this->listingMarkers->contains($listingMarker)) {
  321.             $this->listingMarkers[] = $listingMarker;
  322.             $listingMarker->setLandingPage($this);
  323.         }
  324.         return $this;
  325.     }
  326.     public function removeListingMarker(ListingMarker $listingMarker): self
  327.     {
  328.         if ($this->listingMarkers->contains($listingMarker)) {
  329.             $this->listingMarkers->removeElement($listingMarker);
  330.             // set the owning side to null (unless already changed)
  331.             if ($listingMarker->getLandingPage() === $this) {
  332.                 $listingMarker->setLandingPage(null);
  333.             }
  334.         }
  335.         return $this;
  336.     }
  337.     public function getSpecialForBuyCheaper(): ?bool
  338.     {
  339.         return $this->specialForBuyCheaper;
  340.     }
  341.     public function setSpecialForBuyCheaper(?bool $specialForBuyCheaper): self
  342.     {
  343.         $this->specialForBuyCheaper $specialForBuyCheaper;
  344.         return $this;
  345.     }
  346. }