src/Entity/Master/Feature.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Master;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Table(name="eposm_m_feature")
  9.  * @ORM\Entity(repositoryClass="App\Repository\Master\FeatureRepository")
  10.  */
  11. class Feature
  12. {    
  13.     function getDisplayGroupCategoryAndName(){
  14.         return $this->group->getName().' - '.$this->category->getName().' - '.$this->name;
  15.     }
  16.     /**
  17.      * @ORM\Column(name="id", type="bigint")
  18.      * @ORM\Id
  19.      * @ORM\GeneratedValue(strategy="AUTO")
  20.      */
  21.     protected $id;
  22.     
  23.     /**
  24.      * @ORM\Column(name="name", type="string", length=191)
  25.      */
  26.     protected $name;
  27.     
  28.     /**
  29.      * @ORM\Column(name="sell_cost", type="decimal", scale=2, nullable=true)
  30.      */
  31.     protected $sellCost;
  32.     
  33.     /**
  34.      * @ORM\Column(name="investor_cost", type="decimal", scale=2, nullable=true)
  35.      */
  36.     protected $investorCost;
  37.     
  38.     /**
  39.      * @ORM\Column(name="renew_cost", type="decimal", scale=2, nullable=true)
  40.      */
  41.     protected $renewCost;
  42.     
  43.     /**
  44.      * @ORM\Column(name="investor_commission", type="integer", nullable=true)
  45.      */
  46.     protected $investorCommission;
  47.     /**
  48.      * @ORM\Column(name="signaler_commission", type="integer", nullable=true)
  49.      */
  50.     protected $signalerCommission;
  51.     
  52.     /**
  53.      * @ORM\Column(name="group_level", type="string", nullable=true)
  54.      */
  55.     protected $groupLevel;
  56.     
  57.     /**
  58.      * @ORM\Column(name="visible", type="boolean")
  59.      */
  60.     protected $visible false;
  61.     
  62.     // ManyToOne
  63.         /**
  64.          * @ORM\ManyToOne(targetEntity="App\Entity\Master\FeatureCategory", inversedBy="features")
  65.          * @ORM\JoinColumn(name="category_id", referencedColumnName="id")
  66.          */
  67.         private $category;
  68.         
  69.         /**
  70.          * @ORM\ManyToOne(targetEntity="App\Entity\Master\FeatureGroup", inversedBy="features")
  71.          * @ORM\JoinColumn(name="group_id", referencedColumnName="id")
  72.          */
  73.         private $group;
  74.     //
  75.     // OneToMany
  76.         /**
  77.          * @ORM\OneToMany(targetEntity="App\Entity\Master\JoinTableLicenseFeature", mappedBy="feature")
  78.          */
  79.         private $licenses;
  80.         
  81.         /**
  82.          * @ORM\OneToMany(targetEntity="App\Entity\Master\OrderItem", mappedBy="feature")
  83.          */
  84.         private $orderItems;
  85.         
  86.         /**
  87.          * @ORM\OneToMany(targetEntity="App\Entity\Master\JoinTableCompanyFeature", mappedBy="feature")
  88.          */
  89.         private $investors;
  90.     //
  91.     public function __construct()
  92.     {
  93.         $this->licenses = new ArrayCollection();
  94.         $this->orderItems = new ArrayCollection();
  95.         $this->investors = new ArrayCollection();
  96.     }
  97.     public function getId(): ?string
  98.     {
  99.         return $this->id;
  100.     }
  101.     public function getSellCost(): ?string
  102.     {
  103.         return $this->sellCost;
  104.     }
  105.     public function setSellCost(?string $sellCost): self
  106.     {
  107.         $this->sellCost $sellCost;
  108.         return $this;
  109.     }
  110.     public function getInvestorCost(): ?string
  111.     {
  112.         return $this->investorCost;
  113.     }
  114.     public function setInvestorCost(?string $investorCost): self
  115.     {
  116.         $this->investorCost $investorCost;
  117.         return $this;
  118.     }
  119.     public function getRenewCost(): ?string
  120.     {
  121.         return $this->renewCost;
  122.     }
  123.     public function setRenewCost(?string $renewCost): self
  124.     {
  125.         $this->renewCost $renewCost;
  126.         return $this;
  127.     }
  128.     public function getInvestorCommission(): ?int
  129.     {
  130.         return $this->investorCommission;
  131.     }
  132.     public function setInvestorCommission(?int $investorCommission): self
  133.     {
  134.         $this->investorCommission $investorCommission;
  135.         return $this;
  136.     }
  137.     public function getSignalerCommission(): ?int
  138.     {
  139.         return $this->signalerCommission;
  140.     }
  141.     public function setSignalerCommission(?int $signalerCommission): self
  142.     {
  143.         $this->signalerCommission $signalerCommission;
  144.         return $this;
  145.     }
  146.     public function getGroupLevel(): ?string
  147.     {
  148.         return $this->groupLevel;
  149.     }
  150.     public function setGroupLevel(?string $groupLevel): self
  151.     {
  152.         $this->groupLevel $groupLevel;
  153.         return $this;
  154.     }
  155.     public function isVisible(): ?bool
  156.     {
  157.         return $this->visible;
  158.     }
  159.     public function setVisible(bool $visible): self
  160.     {
  161.         $this->visible $visible;
  162.         return $this;
  163.     }
  164.     public function getCategory(): ?FeatureCategory
  165.     {
  166.         return $this->category;
  167.     }
  168.     public function setCategory(?FeatureCategory $category): self
  169.     {
  170.         $this->category $category;
  171.         return $this;
  172.     }
  173.     public function getGroup(): ?FeatureGroup
  174.     {
  175.         return $this->group;
  176.     }
  177.     public function setGroup(?FeatureGroup $group): self
  178.     {
  179.         $this->group $group;
  180.         return $this;
  181.     }
  182.     /**
  183.      * @return Collection<int, JoinTableLicenseFeature>
  184.      */
  185.     public function getLicenses(): Collection
  186.     {
  187.         return $this->licenses;
  188.     }
  189.     public function addLicense(JoinTableLicenseFeature $license): self
  190.     {
  191.         if (!$this->licenses->contains($license)) {
  192.             $this->licenses->add($license);
  193.             $license->setFeature($this);
  194.         }
  195.         return $this;
  196.     }
  197.     public function removeLicense(JoinTableLicenseFeature $license): self
  198.     {
  199.         if ($this->licenses->removeElement($license)) {
  200.             // set the owning side to null (unless already changed)
  201.             if ($license->getFeature() === $this) {
  202.                 $license->setFeature(null);
  203.             }
  204.         }
  205.         return $this;
  206.     }
  207.     /**
  208.      * @return Collection<int, OrderItem>
  209.      */
  210.     public function getOrderItems(): Collection
  211.     {
  212.         return $this->orderItems;
  213.     }
  214.     public function addOrderItem(OrderItem $orderItem): self
  215.     {
  216.         if (!$this->orderItems->contains($orderItem)) {
  217.             $this->orderItems->add($orderItem);
  218.             $orderItem->setFeature($this);
  219.         }
  220.         return $this;
  221.     }
  222.     public function removeOrderItem(OrderItem $orderItem): self
  223.     {
  224.         if ($this->orderItems->removeElement($orderItem)) {
  225.             // set the owning side to null (unless already changed)
  226.             if ($orderItem->getFeature() === $this) {
  227.                 $orderItem->setFeature(null);
  228.             }
  229.         }
  230.         return $this;
  231.     }
  232.     /**
  233.      * @return Collection<int, JoinTableCompanyFeature>
  234.      */
  235.     public function getInvestors(): Collection
  236.     {
  237.         return $this->investors;
  238.     }
  239.     public function addInvestor(JoinTableCompanyFeature $investor): self
  240.     {
  241.         if (!$this->investors->contains($investor)) {
  242.             $this->investors->add($investor);
  243.             $investor->setFeature($this);
  244.         }
  245.         return $this;
  246.     }
  247.     public function removeInvestor(JoinTableCompanyFeature $investor): self
  248.     {
  249.         if ($this->investors->removeElement($investor)) {
  250.             // set the owning side to null (unless already changed)
  251.             if ($investor->getFeature() === $this) {
  252.                 $investor->setFeature(null);
  253.             }
  254.         }
  255.         return $this;
  256.     }
  257.     public function getName(): ?string
  258.     {
  259.         return $this->name;
  260.     }
  261.     public function setName(string $name): self
  262.     {
  263.         $this->name $name;
  264.         return $this;
  265.     }
  266. }