src/Entity/Gos/OrderType.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use Doctrine\Common\Collections\Collection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. /**
  7.  * OrderType
  8.  *
  9.  * @ORM\Table()
  10.  * @ORM\Entity(repositoryClass="App\Repository\OrderTypeRepository")
  11.  * @ORM\HasLifecycleCallbacks
  12.  */
  13. class OrderType
  14. {
  15.     /**
  16.      * @var int
  17.      *
  18.      * @ORM\Column(name="id", type="integer")
  19.      * @ORM\Id
  20.      * @ORM\GeneratedValue(strategy="AUTO")
  21.      */
  22.     private $id;
  23.     /**
  24.      * @var bool
  25.      *
  26.      * @ORM\Column(name="isActive", type="boolean", nullable=true)
  27.      */
  28.     private $isActive;
  29.     /**
  30.      * @var string
  31.      *
  32.      * @ORM\Column(name="name", type="string", length=255)
  33.      */
  34.     private $name;
  35.     /**
  36.      * @ORM\OneToMany(targetEntity="Orders", mappedBy="orderType")
  37.      */
  38.     private $orders;
  39.     /**
  40.      * @ORM\OneToMany(targetEntity="PortalSettings", mappedBy="orderType")
  41.      */
  42.     private $portalSettings;
  43.     /**
  44.      * @ORM\Column(type="datetime")
  45.      */
  46.     private $createdAt;
  47.     /**
  48.      * @ORM\Column(type="datetime", nullable=true)
  49.      */
  50.     private $updatedAt;
  51.     /** @ORM\PrePersist() */
  52.     public function prePersist()
  53.     {
  54.         $this->createdAt = new \DateTime();
  55.     }
  56.     /** @ORM\PreUpdate() */
  57.     public function preUpdate()
  58.     {
  59.         $this->updatedAt = new \DateTime();
  60.     }
  61.     public function __toString()
  62.     {
  63.         return (string)$this->name;
  64.     }
  65.     /**
  66.      * Get id
  67.      *
  68.      * @return int
  69.      */
  70.     public function getId()
  71.     {
  72.         return $this->id;
  73.     }
  74.     /**
  75.      * Set name
  76.      *
  77.      * @param string $name
  78.      *
  79.      * @return OrderType
  80.      */
  81.     public function setName($name)
  82.     {
  83.         $this->name $name;
  84.         return $this;
  85.     }
  86.     /**
  87.      * Get name
  88.      *
  89.      * @return string
  90.      */
  91.     public function getName()
  92.     {
  93.         return $this->name;
  94.     }
  95.     /**
  96.      * Constructor
  97.      */
  98.     public function __construct()
  99.     {
  100.         $this->orders = new \Doctrine\Common\Collections\ArrayCollection();
  101.         $this->portalSettings = new \Doctrine\Common\Collections\ArrayCollection();
  102.     }
  103.     /**
  104.      * Set createdAt
  105.      *
  106.      * @param \DateTime $createdAt
  107.      *
  108.      * @return OrderType
  109.      */
  110.     public function setCreatedAt($createdAt)
  111.     {
  112.         $this->createdAt $createdAt;
  113.         return $this;
  114.     }
  115.     /**
  116.      * Get createdAt
  117.      *
  118.      * @return \DateTime
  119.      */
  120.     public function getCreatedAt()
  121.     {
  122.         return $this->createdAt;
  123.     }
  124.     /**
  125.      * Set updatedAt
  126.      *
  127.      * @param \DateTime $updatedAt
  128.      *
  129.      * @return OrderType
  130.      */
  131.     public function setUpdatedAt($updatedAt)
  132.     {
  133.         $this->updatedAt $updatedAt;
  134.         return $this;
  135.     }
  136.     /**
  137.      * Get updatedAt
  138.      *
  139.      * @return \DateTime
  140.      */
  141.     public function getUpdatedAt()
  142.     {
  143.         return $this->updatedAt;
  144.     }
  145.     /**
  146.      * Add order
  147.      *
  148.      * @param \App\Entity\Gos\Orders $order
  149.      *
  150.      * @return OrderType
  151.      */
  152.     public function addOrder(\App\Entity\Gos\Orders $order)
  153.     {
  154.         $this->orders[] = $order;
  155.         return $this;
  156.     }
  157.     /**
  158.      * Remove order
  159.      *
  160.      * @param \App\Entity\Gos\Orders $order
  161.      */
  162.     public function removeOrder(\App\Entity\Gos\Orders $order)
  163.     {
  164.         $this->orders->removeElement($order);
  165.     }
  166.     /**
  167.      * Get orders
  168.      *
  169.      * @return \Doctrine\Common\Collections\Collection
  170.      */
  171.     public function getOrders()
  172.     {
  173.         return $this->orders;
  174.     }
  175.     /**
  176.      * Set isActive
  177.      *
  178.      * @param boolean $isActive
  179.      *
  180.      * @return OrderType
  181.      */
  182.     public function setIsActive($isActive)
  183.     {
  184.         $this->isActive $isActive;
  185.         return $this;
  186.     }
  187.     /**
  188.      * Get isActive
  189.      *
  190.      * @return boolean
  191.      */
  192.     public function getIsActive()
  193.     {
  194.         return $this->isActive;
  195.     }
  196.     /**
  197.      * Add portalSetting
  198.      *
  199.      * @param \App\Entity\Gos\PortalSettings $portalSetting
  200.      *
  201.      * @return OrderType
  202.      */
  203.     public function addPortalSetting(\App\Entity\Gos\PortalSettings $portalSetting)
  204.     {
  205.         $this->portalSettings[] = $portalSetting;
  206.         return $this;
  207.     }
  208.     /**
  209.      * Remove portalSetting
  210.      *
  211.      * @param \App\Entity\Gos\PortalSettings $portalSetting
  212.      */
  213.     public function removePortalSetting(\App\Entity\Gos\PortalSettings $portalSetting)
  214.     {
  215.         $this->portalSettings->removeElement($portalSetting);
  216.     }
  217.     /**
  218.      * Get portalSettings
  219.      *
  220.      * @return \Doctrine\Common\Collections\Collection
  221.      */
  222.     public function getPortalSettings()
  223.     {
  224.         return $this->portalSettings;
  225.     }
  226. }