<?phpnamespace App\Entity\Gos;use Doctrine\ORM\Mapping as ORM;use JMS\Serializer\Annotation as JMS;/** * AccessLevel * * @ORM\Table(name="access_level") * @ORM\Entity(repositoryClass="App\Repository\AccessLevelRepository") * @ORM\HasLifecycleCallbacks */class AccessLevel{ /** * @var int * * @ORM\Column(name="id", type="integer") * @ORM\Id * @ORM\GeneratedValue(strategy="AUTO") * @JMS\Groups({"PortalSettings"}) */ private $id; /** * @var int * * @ORM\Column(name="level", type="integer") * @JMS\Groups({"PortalSettings"}) */ private $level; /** * @ORM\ManyToOne(targetEntity="App\Entity\Gos\PortalSettings", inversedBy="accessLevels", fetch="EAGER") * @ORM\JoinColumn() */ private $portalSettings; /** * @ORM\ManyToOne(targetEntity="App\Entity\Gos\ProductVariant", inversedBy="accessLevel") * @ORM\JoinColumn(onDelete="CASCADE") */ private $productVariant; /** * @ORM\Column(type="datetime") */ private $createdAt; /** * @ORM\Column(type="datetime", nullable=true) */ private $updatedAt; /** @ORM\PrePersist() */ public function prePersist() { $this->createdAt = new \DateTime(); } /** @ORM\PreUpdate() */ public function preUpdate() { $this->updatedAt = new \DateTime(); } public function __toString() { return (string)$this->productVariant.' level: '. $this->level; } /** * Get id * * @return integer */ public function getId() { return $this->id; } /** * Set level * * @param integer $level * * @return AccessLevel */ public function setLevel($level) { $this->level = $level; return $this; } /** * Get level * * @return integer */ public function getLevel() { return $this->level; } /** * Set createdAt * * @param \DateTime $createdAt * * @return AccessLevel */ public function setCreatedAt($createdAt) { $this->createdAt = $createdAt; return $this; } /** * Get createdAt * * @return \DateTime */ public function getCreatedAt() { return $this->createdAt; } /** * Set updatedAt * * @param \DateTime $updatedAt * * @return AccessLevel */ public function setUpdatedAt($updatedAt) { $this->updatedAt = $updatedAt; return $this; } /** * Get updatedAt * * @return \DateTime */ public function getUpdatedAt() { return $this->updatedAt; } /** * Set portalSettings * * @param \App\Entity\Gos\PortalSettings $portalSettings * * @return AccessLevel */ public function setPortalSettings(\App\Entity\Gos\PortalSettings $portalSettings = null) { $this->portalSettings = $portalSettings; return $this; } /** * Get portalSettings * * @return \App\Entity\Gos\PortalSettings */ public function getPortalSettings() { return $this->portalSettings; } /** * Set productVariant * * @param \App\Entity\Gos\ProductVariant $productVariant * * @return AccessLevel */ public function setProductVariant(\App\Entity\Gos\ProductVariant $productVariant = null) { $this->productVariant = $productVariant; return $this; } /** * Get productVariant * * @return \App\Entity\Gos\ProductVariant */ public function getProductVariant() { return $this->productVariant; }}