src/Entity/Shoppingmall.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use DateTime;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * Shoppingmalls
  7.  *
  8.  * @ORM\Table(name="shoppingmalls", indexes={@ORM\Index(name="fk_shoppingmalls_cities1_idx", columns={"city"})})
  9.  * @ORM\Entity(repositoryClass="App\Repository\ShoppingMallRepository")
  10.  */
  11. class Shoppingmall
  12. {
  13.     /**
  14.      * @var int
  15.      *
  16.      * @ORM\Column(name="shoppingmall_id", type="integer", nullable=false)
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue(strategy="IDENTITY")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @var string
  23.      *
  24.      * @ORM\Column(name="_id", type="string", nullable=true)
  25.      */
  26.     protected $_id;
  27.     /**
  28.      * @var string
  29.      *
  30.      * @ORM\Column(name="label", type="string", length=255, nullable=true)
  31.      */
  32.     private $label;
  33.     /**
  34.      * @var string|null
  35.      *
  36.      * @ORM\Column(name="opening_hr", type="string", length=255, nullable=true)
  37.      */
  38.     private $openingHr;
  39.     /**
  40.      * @var string|null
  41.      *
  42.      * @ORM\Column(name="street", type="string", length=255, nullable=true)
  43.      */
  44.     private $street;
  45.     /**
  46.      * @var string|null
  47.      *
  48.      * @ORM\Column(name="zip", type="string", length=255, nullable=true)
  49.      */
  50.     private $zip;
  51.     /**
  52.      * @var bool|null
  53.      *
  54.      * @ORM\Column(name="is_outlet", type="integer", nullable=true)
  55.      */
  56.     private $isOutlet;
  57.     /**
  58.      * @var bool|null
  59.      *
  60.      * @ORM\Column(name="is_new", type="boolean", nullable=true)
  61.      */
  62.     private $isNew;
  63.     /**
  64.      * @var bool|null
  65.      *
  66.      * @ORM\Column(name="is_active", type="boolean", nullable=true)
  67.      */
  68.     private $isActive;
  69.     /**
  70.      * @var \DateTime|null
  71.      *
  72.      * @ORM\Column(name="is_new_date", type="datetime", nullable=true)
  73.      */
  74.     private $isNewDate;
  75.     /**
  76.      * @var string|null
  77.      *
  78.      * @ORM\Column(name="www", type="string", length=255, nullable=true)
  79.      */
  80.     private $www;
  81.     /**
  82.      * @var string|null
  83.      *
  84.      * @ORM\Column(name="apitime", type="string", length=255, nullable=true)
  85.      */
  86.     private $apitime;
  87.     /**
  88.      * @var string|null
  89.      *
  90.      * @ORM\Column(name="apigeo", type="string", length=255, nullable=true)
  91.      */
  92.     private $apigeo;
  93.     /**
  94.      * @var float|null
  95.      *
  96.      * @ORM\Column(name="latitude", type="float", precision=10, scale=0, nullable=true)
  97.      */
  98.     private $latitude;
  99.     /**
  100.      * @var float|null
  101.      *
  102.      * @ORM\Column(name="longitude", type="float", precision=10, scale=0, nullable=true)
  103.      */
  104.     private $longitude;
  105.     /**
  106.      * @var string|null
  107.      *
  108.      * @ORM\Column(name="special_offer", type="string", length=255, nullable=true)
  109.      */
  110.     private $specialOffer;
  111.     /**
  112.      * @var string|null
  113.      *
  114.      * @ORM\Column(name="mapurl", type="string", length=255, nullable=true)
  115.      */
  116.     private $mapurl;
  117.     /**
  118.      * @return string|null
  119.      */
  120.     public function getMapurl(): ?string
  121.     {
  122.         return $this->mapurl;
  123.     }
  124.     /**
  125.      * @param string|null $mapurl
  126.      */
  127.     public function setMapurl(?string $mapurl): void
  128.     {
  129.         $this->mapurl $mapurl;
  130.     }
  131.     /**
  132.      * Last GEO directions load time
  133.      * @var DateTime|null
  134.      *
  135.      * @ORM\Column(name="last_sync_time", type="datetimetz", nullable=true)
  136.      */
  137.     private $lastSyncTime;
  138.     /**
  139.      * Created Date
  140.      * @var DateTime|null
  141.      *
  142.      * @ORM\Column(name="created_at", type="datetimetz", nullable=true)
  143.      */
  144.     private $createdAt;
  145.     /**
  146.      * Updated Date
  147.      * @var DateTime|null
  148.      *
  149.      * @ORM\Column(name="updated_at", type="datetimetz", nullable=true)
  150.      */
  151.     private $updatedAt;
  152.     /**
  153.      * @var \App\Entity\City
  154.      *
  155.      * @ORM\ManyToOne(targetEntity="App\Entity\City")
  156.      * @ORM\JoinColumns({
  157.      *   @ORM\JoinColumn(name="city", referencedColumnName="city_id")
  158.      * })
  159.      */
  160.     private $city;
  161.     /**
  162.      * @var \Doctrine\Common\Collections\Collection
  163.      *
  164.      * @ORM\ManyToMany(targetEntity="App\Entity\Article", mappedBy="shoppingmalls")
  165.      */
  166.     private $articles;
  167.     /**
  168.      * @ORM\OneToMany(targetEntity="App\Entity\Shop", mappedBy="shoppingMall")
  169.      */
  170.     private $shops;
  171.     /**
  172.      * @ORM\ManyToOne(targetEntity=Operator::class, inversedBy="shoppingMalls")
  173.      * @ORM\JoinColumn(name="operator", nullable=true)
  174.      */
  175.     private $operator;
  176.     /**
  177.      * Constructor
  178.      */
  179.     public function __construct()
  180.     {
  181.         $this->articles = new \Doctrine\Common\Collections\ArrayCollection();
  182.     }
  183.     /************************************************************************************************************/
  184.     /****** COLLECTIONS METHODS *********************************************************************************/
  185.     /************************************************************************************************************/
  186.     /**
  187.      * @param \App\Entity\Article $article
  188.      * @return bool
  189.      */
  190.     public function addArticle(Article $article)
  191.     {
  192.         return $this->articles->add($article);
  193.     }
  194.     /**
  195.      * @param \App\Entity\Article $article
  196.      * @return mixed|null
  197.      */
  198.     public function removeArticle(Article $article)
  199.     {
  200.         return $this->articles->remove($article);
  201.     }
  202.     /**
  203.      * @return \Doctrine\Common\Collections\Collection|\App\Entity\Article[]
  204.      */
  205.     public function getArticles(): \Doctrine\Common\Collections\Collection
  206.     {
  207.         return $this->articles;
  208.     }
  209.     /**
  210.      * @return \Doctrine\Common\Collections\Collection|\App\Entity\Shop[]
  211.      */
  212.     public function getShops(): \Doctrine\Common\Collections\Collection
  213.     {
  214.         return $this->shops;
  215.     }
  216.     /************************************************************************************************************/
  217.     /****** GETTERS & SETTERS ***********************************************************************************/
  218.     /************************************************************************************************************/
  219.     /**
  220.      * @return int
  221.      */
  222.     public function getId(): int
  223.     {
  224.         return $this->id;
  225.     }
  226.     /**
  227.      * @param int $id
  228.      */
  229.     public function setId(int $id): void
  230.     {
  231.         $this->id $id;
  232.     }
  233.     /**
  234.      * @return string
  235.      */
  236.     public function getMongoId(): string
  237.     {
  238.         return $this->_id;
  239.     }
  240.     /**
  241.      * @return string
  242.      */
  243.     public function getLabel(): ?string
  244.     {
  245.         return $this->label;
  246.     }
  247.     /**
  248.      * @param string $label
  249.      */
  250.     public function setLabel(string $label): void
  251.     {
  252.         $this->label $label;
  253.     }
  254.     /**
  255.      * @return string|null
  256.      */
  257.     public function getOpeningHr(): ?string
  258.     {
  259.         return $this->openingHr;
  260.     }
  261.     /**
  262.      * @param string|null $openingHr
  263.      */
  264.     public function setOpeningHr(?string $openingHr): void
  265.     {
  266.         $this->openingHr $openingHr;
  267.     }
  268.     /**
  269.      * @return string|null
  270.      */
  271.     public function getStreet(): ?string
  272.     {
  273.         return $this->street;
  274.     }
  275.     /**
  276.      * @param string|null $street
  277.      */
  278.     public function setStreet(?string $street): void
  279.     {
  280.         $this->street $street;
  281.     }
  282.     /**
  283.      * @return string|null
  284.      */
  285.     public function getZip(): ?string
  286.     {
  287.         return $this->zip;
  288.     }
  289.     /**
  290.      * @param string|null $zip
  291.      */
  292.     public function setZip(?string $zip): void
  293.     {
  294.         $this->zip $zip;
  295.     }
  296.     /**
  297.      * @return integer|null
  298.      */
  299.     public function getIsOutlet(): ?int
  300.     {
  301.         return $this->isOutlet;
  302.     }
  303.     /**
  304.      * @param integer|null $isOutlet
  305.      */
  306.     public function setIsOutlet($isOutlet): void
  307.     {
  308.         $this->isOutlet $isOutlet;
  309.     }
  310.     /**
  311.      * @return bool|null
  312.      */
  313.     public function getIsNew(): ?bool
  314.     {
  315.         return $this->isNew;
  316.     }
  317.     /**
  318.      * @param bool|null $isOutlet
  319.      */
  320.     public function setIsNew(?bool $isNew): void
  321.     {
  322.         $this->isNew $isNew;
  323.     }
  324.     /**
  325.      * @return bool|null
  326.      */
  327.     public function getIsActive(): ?bool
  328.     {
  329.         return $this->isActive;
  330.     }
  331.     /**
  332.      * @param bool|null $isActive
  333.      */
  334.     public function setIsActive(?bool $isActive): void
  335.     {
  336.         $this->isActive $isActive;
  337.     }
  338.     /**
  339.      * @return DateTime|null
  340.      */
  341.     public function getIsNewDate(): ?DateTime
  342.     {
  343.         return $this->isNewDate;
  344.     }
  345.     /**
  346.      * @param DateTime|null $isNewDate
  347.      */
  348.     public function setIsNewDate(?DateTime $isNewDate): void
  349.     {
  350.         $this->isNewDate $isNewDate;
  351.     }
  352.     /**
  353.      * @return string|null
  354.      */
  355.     public function getWww(): ?string
  356.     {
  357.         return $this->www;
  358.     }
  359.     /**
  360.      * @param string|null $www
  361.      */
  362.     public function setWww(?string $www): void
  363.     {
  364.         $this->www $www;
  365.     }
  366.     /**
  367.      * @return string|null
  368.      */
  369.     public function getApitime(): ?string
  370.     {
  371.         return $this->apitime;
  372.     }
  373.     /**
  374.      * @param string|null $apitime
  375.      */
  376.     public function setApitime(?string $apitime): void
  377.     {
  378.         $this->apitime $apitime;
  379.     }
  380.     /**
  381.      * @return string|null
  382.      */
  383.     public function getApigeo(): ?string
  384.     {
  385.         return $this->apigeo;
  386.     }
  387.     /**
  388.      * @param string|null $apigeo
  389.      */
  390.     public function setApigeo(?string $apigeo): void
  391.     {
  392.         $this->apigeo $apigeo;
  393.     }
  394.     /**
  395.      * @return float|null
  396.      */
  397.     public function getLatitude(): ?float
  398.     {
  399.         return $this->latitude;
  400.     }
  401.     /**
  402.      * @param float|null $latitude
  403.      */
  404.     public function setLatitude(?float $latitude): void
  405.     {
  406.         $this->latitude $latitude;
  407.     }
  408.     /**
  409.      * @return float|null
  410.      */
  411.     public function getLongitude(): ?float
  412.     {
  413.         return $this->longitude;
  414.     }
  415.     /**
  416.      * @param float|null $longitude
  417.      */
  418.     public function setLongitude(?float $longitude): void
  419.     {
  420.         $this->longitude $longitude;
  421.     }
  422.     /**
  423.      * @return string|null
  424.      */
  425.     public function getSpecialOffer(): ?string
  426.     {
  427.         return $this->specialOffer;
  428.     }
  429.     /**
  430.      * @param string|null $specialOffer
  431.      */
  432.     public function setSpecialOffer(?string $specialOffer): void
  433.     {
  434.         $this->specialOffer $specialOffer;
  435.     }
  436.     /**
  437.      * @return \App\Entity\City
  438.      */
  439.     public function getCity(): ?\App\Entity\City
  440.     {
  441.         return $this->city;
  442.     }
  443.     /**
  444.      * @param \App\Entity\City $city
  445.      */
  446.     public function setCity(\App\Entity\City $city): void
  447.     {
  448.         $this->city $city;
  449.     }
  450.     /**
  451.      * @return DateTime|null
  452.      */
  453.     public function getLastSyncTime(): ?DateTime
  454.     {
  455.         return $this->lastSyncTime;
  456.     }
  457.     /**
  458.      * @param string|null $lastSyncTime
  459.      */
  460.     public function setLastSyncTime(?string $lastSyncTime): void
  461.     {
  462.         $this->lastSyncTime $lastSyncTime;
  463.     }
  464.     /**
  465.      * @return DateTime|null
  466.      */
  467.     public function getCreatedAt(): ?DateTime
  468.     {
  469.         return $this->createdAt;
  470.     }
  471.     /**
  472.      * @param string|null $createdAt
  473.      */
  474.     public function setCreatedAt(?string $createdAt): void
  475.     {
  476.         $this->createdAt $createdAt;
  477.     }
  478.     /**
  479.      * @return \DateTime|null
  480.      */
  481.     public function getUpdatedAt(): ?\DateTime
  482.     {
  483.         return $this->updatedAt;
  484.     }
  485.     /**
  486.      * @param string|null $updatedAt
  487.      */
  488.     public function setUpdatedAt(?string $updatedAt): void
  489.     {
  490.         $this->updatedAt $updatedAt;
  491.     }
  492.     /**
  493.      * Return data in array. Used by REST API
  494.      *
  495.      * @return array
  496.      */
  497.     public function toArray()
  498.     {
  499.         return [
  500.             'id' => $this->getId(),
  501.             'label' => $this->getLabel(),
  502.             'street' => $this->getStreet(),
  503.             'city' => ($this->getCity() ? $this->getCity()->getId() : -1),
  504.             'zip' => $this->getZip(),
  505.             'openingHr' => $this->getOpeningHr(),
  506.         ];
  507.     }
  508.     public function __toString()
  509.     {
  510.         return (string)$this->getLabel();
  511.     }
  512.     public function getOperator(): ?Operator
  513.     {
  514.         return $this->operator;
  515.     }
  516.     public function setOperator(?Operator $operator): self
  517.     {
  518.         $this->operator $operator;
  519.         return $this;
  520.     }
  521. }