src/Entity/Gos/AccessLevel.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use JMS\Serializer\Annotation as JMS;
  5. /**
  6.  * AccessLevel
  7.  *
  8.  * @ORM\Table(name="access_level")
  9.  * @ORM\Entity(repositoryClass="App\Repository\AccessLevelRepository")
  10.  * @ORM\HasLifecycleCallbacks
  11.  */
  12. class AccessLevel
  13. {
  14.     /**
  15.      * @var int
  16.      *
  17.      * @ORM\Column(name="id", type="integer")
  18.      * @ORM\Id
  19.      * @ORM\GeneratedValue(strategy="AUTO")
  20.      * @JMS\Groups({"PortalSettings"})
  21.      */
  22.     private $id;
  23.     /**
  24.      * @var int
  25.      *
  26.      * @ORM\Column(name="level", type="integer")
  27.      * @JMS\Groups({"PortalSettings"})
  28.      */
  29.     private $level;
  30.     /**
  31.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\PortalSettings", inversedBy="accessLevels", fetch="EAGER")
  32.      * @ORM\JoinColumn()
  33.      */
  34.     private $portalSettings;
  35.     /**
  36.     * @ORM\ManyToOne(targetEntity="App\Entity\Gos\ProductVariant", inversedBy="accessLevel")
  37.     * @ORM\JoinColumn(onDelete="CASCADE")
  38.     */
  39.     private $productVariant;
  40.     /**
  41.      * @ORM\Column(type="datetime")
  42.      */
  43.     private $createdAt;
  44.     /**
  45.      * @ORM\Column(type="datetime", nullable=true)
  46.      */
  47.     private $updatedAt;
  48.     /** @ORM\PrePersist() */
  49.     public function prePersist()
  50.     {
  51.         $this->createdAt = new \DateTime();
  52.     }
  53.     /** @ORM\PreUpdate() */
  54.     public function preUpdate()
  55.     {
  56.         $this->updatedAt = new \DateTime();
  57.     }
  58.     public function __toString()
  59.     {
  60.         return (string)$this->productVariant.' level: '$this->level;
  61.     }
  62.    
  63.     /**
  64.      * Get id
  65.      *
  66.      * @return integer
  67.      */
  68.     public function getId()
  69.     {
  70.         return $this->id;
  71.     }
  72.     /**
  73.      * Set level
  74.      *
  75.      * @param integer $level
  76.      *
  77.      * @return AccessLevel
  78.      */
  79.     public function setLevel($level)
  80.     {
  81.         $this->level $level;
  82.         return $this;
  83.     }
  84.     /**
  85.      * Get level
  86.      *
  87.      * @return integer
  88.      */
  89.     public function getLevel()
  90.     {
  91.         return $this->level;
  92.     }
  93.     /**
  94.      * Set createdAt
  95.      *
  96.      * @param \DateTime $createdAt
  97.      *
  98.      * @return AccessLevel
  99.      */
  100.     public function setCreatedAt($createdAt)
  101.     {
  102.         $this->createdAt $createdAt;
  103.         return $this;
  104.     }
  105.     /**
  106.      * Get createdAt
  107.      *
  108.      * @return \DateTime
  109.      */
  110.     public function getCreatedAt()
  111.     {
  112.         return $this->createdAt;
  113.     }
  114.     /**
  115.      * Set updatedAt
  116.      *
  117.      * @param \DateTime $updatedAt
  118.      *
  119.      * @return AccessLevel
  120.      */
  121.     public function setUpdatedAt($updatedAt)
  122.     {
  123.         $this->updatedAt $updatedAt;
  124.         return $this;
  125.     }
  126.     /**
  127.      * Get updatedAt
  128.      *
  129.      * @return \DateTime
  130.      */
  131.     public function getUpdatedAt()
  132.     {
  133.         return $this->updatedAt;
  134.     }
  135.     /**
  136.      * Set portalSettings
  137.      *
  138.      * @param \App\Entity\Gos\PortalSettings $portalSettings
  139.      *
  140.      * @return AccessLevel
  141.      */
  142.     public function setPortalSettings(\App\Entity\Gos\PortalSettings $portalSettings null)
  143.     {
  144.         $this->portalSettings $portalSettings;
  145.         return $this;
  146.     }
  147.     /**
  148.      * Get portalSettings
  149.      *
  150.      * @return \App\Entity\Gos\PortalSettings
  151.      */
  152.     public function getPortalSettings()
  153.     {
  154.         return $this->portalSettings;
  155.     }
  156.     /**
  157.      * Set productVariant
  158.      *
  159.      * @param \App\Entity\Gos\ProductVariant $productVariant
  160.      *
  161.      * @return AccessLevel
  162.      */
  163.     public function setProductVariant(\App\Entity\Gos\ProductVariant $productVariant null)
  164.     {
  165.         $this->productVariant $productVariant;
  166.         return $this;
  167.     }
  168.     /**
  169.      * Get productVariant
  170.      *
  171.      * @return \App\Entity\Gos\ProductVariant
  172.      */
  173.     public function getProductVariant()
  174.     {
  175.         return $this->productVariant;
  176.     }
  177. }