<?php
namespace App\Entity\Master;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table(name="eposm_m_feature")
* @ORM\Entity(repositoryClass="App\Repository\Master\FeatureRepository")
*/
class Feature
{
function getDisplayGroupCategoryAndName(){
return $this->group->getName().' - '.$this->category->getName().' - '.$this->name;
}
/**
* @ORM\Column(name="id", type="bigint")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(name="name", type="string", length=191)
*/
protected $name;
/**
* @ORM\Column(name="sell_cost", type="decimal", scale=2, nullable=true)
*/
protected $sellCost;
/**
* @ORM\Column(name="investor_cost", type="decimal", scale=2, nullable=true)
*/
protected $investorCost;
/**
* @ORM\Column(name="renew_cost", type="decimal", scale=2, nullable=true)
*/
protected $renewCost;
/**
* @ORM\Column(name="investor_commission", type="integer", nullable=true)
*/
protected $investorCommission;
/**
* @ORM\Column(name="signaler_commission", type="integer", nullable=true)
*/
protected $signalerCommission;
/**
* @ORM\Column(name="group_level", type="string", nullable=true)
*/
protected $groupLevel;
/**
* @ORM\Column(name="visible", type="boolean")
*/
protected $visible = false;
// ManyToOne
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Master\FeatureCategory", inversedBy="features")
* @ORM\JoinColumn(name="category_id", referencedColumnName="id")
*/
private $category;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\Master\FeatureGroup", inversedBy="features")
* @ORM\JoinColumn(name="group_id", referencedColumnName="id")
*/
private $group;
//
// OneToMany
/**
* @ORM\OneToMany(targetEntity="App\Entity\Master\JoinTableLicenseFeature", mappedBy="feature")
*/
private $licenses;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Master\OrderItem", mappedBy="feature")
*/
private $orderItems;
/**
* @ORM\OneToMany(targetEntity="App\Entity\Master\JoinTableCompanyFeature", mappedBy="feature")
*/
private $investors;
//
public function __construct()
{
$this->licenses = new ArrayCollection();
$this->orderItems = new ArrayCollection();
$this->investors = new ArrayCollection();
}
public function getId(): ?string
{
return $this->id;
}
public function getSellCost(): ?string
{
return $this->sellCost;
}
public function setSellCost(?string $sellCost): self
{
$this->sellCost = $sellCost;
return $this;
}
public function getInvestorCost(): ?string
{
return $this->investorCost;
}
public function setInvestorCost(?string $investorCost): self
{
$this->investorCost = $investorCost;
return $this;
}
public function getRenewCost(): ?string
{
return $this->renewCost;
}
public function setRenewCost(?string $renewCost): self
{
$this->renewCost = $renewCost;
return $this;
}
public function getInvestorCommission(): ?int
{
return $this->investorCommission;
}
public function setInvestorCommission(?int $investorCommission): self
{
$this->investorCommission = $investorCommission;
return $this;
}
public function getSignalerCommission(): ?int
{
return $this->signalerCommission;
}
public function setSignalerCommission(?int $signalerCommission): self
{
$this->signalerCommission = $signalerCommission;
return $this;
}
public function getGroupLevel(): ?string
{
return $this->groupLevel;
}
public function setGroupLevel(?string $groupLevel): self
{
$this->groupLevel = $groupLevel;
return $this;
}
public function isVisible(): ?bool
{
return $this->visible;
}
public function setVisible(bool $visible): self
{
$this->visible = $visible;
return $this;
}
public function getCategory(): ?FeatureCategory
{
return $this->category;
}
public function setCategory(?FeatureCategory $category): self
{
$this->category = $category;
return $this;
}
public function getGroup(): ?FeatureGroup
{
return $this->group;
}
public function setGroup(?FeatureGroup $group): self
{
$this->group = $group;
return $this;
}
/**
* @return Collection<int, JoinTableLicenseFeature>
*/
public function getLicenses(): Collection
{
return $this->licenses;
}
public function addLicense(JoinTableLicenseFeature $license): self
{
if (!$this->licenses->contains($license)) {
$this->licenses->add($license);
$license->setFeature($this);
}
return $this;
}
public function removeLicense(JoinTableLicenseFeature $license): self
{
if ($this->licenses->removeElement($license)) {
// set the owning side to null (unless already changed)
if ($license->getFeature() === $this) {
$license->setFeature(null);
}
}
return $this;
}
/**
* @return Collection<int, OrderItem>
*/
public function getOrderItems(): Collection
{
return $this->orderItems;
}
public function addOrderItem(OrderItem $orderItem): self
{
if (!$this->orderItems->contains($orderItem)) {
$this->orderItems->add($orderItem);
$orderItem->setFeature($this);
}
return $this;
}
public function removeOrderItem(OrderItem $orderItem): self
{
if ($this->orderItems->removeElement($orderItem)) {
// set the owning side to null (unless already changed)
if ($orderItem->getFeature() === $this) {
$orderItem->setFeature(null);
}
}
return $this;
}
/**
* @return Collection<int, JoinTableCompanyFeature>
*/
public function getInvestors(): Collection
{
return $this->investors;
}
public function addInvestor(JoinTableCompanyFeature $investor): self
{
if (!$this->investors->contains($investor)) {
$this->investors->add($investor);
$investor->setFeature($this);
}
return $this;
}
public function removeInvestor(JoinTableCompanyFeature $investor): self
{
if ($this->investors->removeElement($investor)) {
// set the owning side to null (unless already changed)
if ($investor->getFeature() === $this) {
$investor->setFeature(null);
}
}
return $this;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
}