src/Entity/BaseSite/Plan/Feature.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\BaseSite\Plan;
  3. use App\Entity\BaseEntity;
  4. use App\Repository\BaseSite\Plan\FeatureRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Symfony\Bridge\Doctrine\IdGenerator\UuidGenerator;
  10. #[ORM\Entity(repositoryClassFeatureRepository::class)]
  11. class Feature extends BaseEntity
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\Column(type'guid'uniquetrue)]
  15.     #[ORM\GeneratedValue(strategy'CUSTOM')]
  16.     #[ORM\CustomIdGenerator(class: UuidGenerator::class)]
  17.     private ?string $id;
  18.     #[ORM\Column(length255)]
  19.     private ?string $name null;
  20.     #[ORM\Column(typeTypes::BIGINT)]
  21.     private ?string $pricePerUnit null;
  22.     #[ORM\Column(length255)]
  23.     private ?string $unit null;
  24.     #[ORM\Column(typeTypes::BIGINT)]
  25.     private ?string $pricePerExtraUnit null;
  26.     #[ORM\OneToMany(mappedBy'feature'targetEntityPlanFeature::class)]
  27.     private Collection $planFeatures;
  28.     #[ORM\OneToMany(mappedBy'feature'targetEntityAddOn::class)]
  29.     private Collection $addOns;
  30.     #[ORM\Column(length255)]
  31.     private ?string $valueType 'integer'// یا 'boolean'
  32.     #[ORM\Column(length255)]
  33.     private ?string $featureKey null;
  34.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  35.     private ?string $details null;
  36.     #[ORM\Column(length255nullabletrue)]
  37.     private ?string $icon null;
  38.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  39.     private ?string $content null;
  40.     public function __construct()
  41.     {
  42.         parent::__construct();
  43.         $this->planFeatures = new ArrayCollection();
  44.         $this->addOns = new ArrayCollection();
  45.     }
  46.     public function getId(): ?string
  47.     {
  48.         return $this->id;
  49.     }
  50.     public function getName(): ?string
  51.     {
  52.         return $this->name;
  53.     }
  54.     public function setName(string $name): static
  55.     {
  56.         $this->name $name;
  57.         return $this;
  58.     }
  59.     public function getPricePerUnit(): ?string
  60.     {
  61.         return $this->pricePerUnit;
  62.     }
  63.     public function setPricePerUnit(string $pricePerUnit): static
  64.     {
  65.         $this->pricePerUnit $pricePerUnit;
  66.         return $this;
  67.     }
  68.     public function getUnit(): ?string
  69.     {
  70.         return $this->unit;
  71.     }
  72.     public function setUnit(string $unit): static
  73.     {
  74.         $this->unit $unit;
  75.         return $this;
  76.     }
  77.     public function getPricePerExtraUnit(): ?string
  78.     {
  79.         return $this->pricePerExtraUnit;
  80.     }
  81.     public function setPricePerExtraUnit(string $pricePerExtraUnit): static
  82.     {
  83.         $this->pricePerExtraUnit $pricePerExtraUnit;
  84.         return $this;
  85.     }
  86.     /**
  87.      * @return Collection<int, PlanFeature>
  88.      */
  89.     public function getPlanFeatures(): Collection
  90.     {
  91.         return $this->planFeatures;
  92.     }
  93.     public function addPlanFeature(PlanFeature $planFeature): static
  94.     {
  95.         if (!$this->planFeatures->contains($planFeature)) {
  96.             $this->planFeatures->add($planFeature);
  97.             $planFeature->setFeature($this);
  98.         }
  99.         return $this;
  100.     }
  101.     public function removePlanFeature(PlanFeature $planFeature): static
  102.     {
  103.         if ($this->planFeatures->removeElement($planFeature)) {
  104.             // set the owning side to null (unless already changed)
  105.             if ($planFeature->getFeature() === $this) {
  106.                 $planFeature->setFeature(null);
  107.             }
  108.         }
  109.         return $this;
  110.     }
  111.     /**
  112.      * @return Collection<int, AddOn>
  113.      */
  114.     public function getAddOns(): Collection
  115.     {
  116.         return $this->addOns;
  117.     }
  118.     public function addAddOn(AddOn $addOn): static
  119.     {
  120.         if (!$this->addOns->contains($addOn)) {
  121.             $this->addOns->add($addOn);
  122.             $addOn->setFeature($this);
  123.         }
  124.         return $this;
  125.     }
  126.     public function removeAddOn(AddOn $addOn): static
  127.     {
  128.         if ($this->addOns->removeElement($addOn)) {
  129.             // set the owning side to null (unless already changed)
  130.             if ($addOn->getFeature() === $this) {
  131.                 $addOn->setFeature(null);
  132.             }
  133.         }
  134.         return $this;
  135.     }
  136.     public function getFeatureKey(): ?string
  137.     {
  138.         return $this->featureKey;
  139.     }
  140.     public function setFeatureKey(string $featureKey): static
  141.     {
  142.         $this->featureKey $featureKey;
  143.         return $this;
  144.     }
  145.     public function getValueType(): ?string
  146.     {
  147.         return $this->valueType;
  148.     }
  149.     public function setValueType(?string $valueType): void
  150.     {
  151.         $this->valueType $valueType;
  152.     }
  153.     public function getDetails(): ?string
  154.     {
  155.         return $this->details;
  156.     }
  157.     public function setDetails(?string $details): static
  158.     {
  159.         $this->details $details;
  160.         return $this;
  161.     }
  162.     public function getIcon(): ?string
  163.     {
  164.         return $this->icon;
  165.     }
  166.     public function setIcon(?string $icon): static
  167.     {
  168.         $this->icon $icon;
  169.         return $this;
  170.     }
  171.     public function getContent(): ?string
  172.     {
  173.         return $this->content;
  174.     }
  175.     public function setContent(?string $content): static
  176.     {
  177.         $this->content $content;
  178.         return $this;
  179.     }
  180. }