<?php
namespace App\Entity;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Doctrine\Common\Collections\Criteria;
/**
* @ORM\Entity(repositoryClass="App\Repository\CustomerSiteLevelRepository")
*/
class CustomerSiteLevel
{
const LEVEL_PREMIUM = 1000;
const LEVEL_BEST = 2000;
const LEVEL_BETTER = 3000;
const LEVEL_GOOD = 4000;
const LEVEL_RCLUB = 4001;
const LEVEL_PARTNER = 5000;
const LEVEL_STANDARD = 6000;
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="bigint")
*/
private $id;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Customer", inversedBy="levels", cascade={"persist"})
* @ORM\JoinColumn(name="customer_id", referencedColumnName="id", onDelete="CASCADE")
*/
private $customer;
/* *
* @ ORM\ManyToOne(targetEntity="App\Entity\Site", inversedBy="levels", cascade={"persist"})
* @ ORM\JoinColumn(name="site_id", referencedColumnName="id", onDelete="CASCADE")
* /
private $site;*/
/**
* @ORM\Column(type="integer", length=11)
*/
private $site_id;
/**
* @ORM\Column(type="integer")
*/
private $level;
public function __construct ()
{
$this->site_id = 0;
$this->level = 6000;
}
public function getCustomer(): ?Customer
{
return $this->customer;
}
public function setCustomer(?Customer $customer): self
{
$this->customer = $customer;
return $this;
}
/*
public function getSite(): ?Site
{
return $this->site;
}
public function setSite(?Site $site): self
{
$this->site = $site;
return $this;
}
*/
public function getSiteId(): int
{
return $this->site_id;
}
public function setSiteId(int $site_id): self
{
$this->site_id = $site_id;
return $this;
}
public function getLevel(): ?int
{
return $this->level;
}
public function setLevel(int $level): self
{
$this->level = $level;
return $this;
}
public function getCustomerLevelString()
{
switch($this->level) {
case 1000:
return "Premium";
case 2000:
return "Best";
case 3000:
return "Better";
case 4000:
return "Good";
case 5000:
return "Partner";
case 6000:
return "Standard";
default:
return "Standard";
}
}
}