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

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