<?phpnamespace App\Entity;use Doctrine\ORM\Mapping as ORM;use Wits\PaymentBundle\Entity\LineItemInterface;/** * * @ORM\Table(name="credit_pack") * @ORM\Entity(repositoryClass="App\Repository\CreditPackRepository") * * @ORM\InheritanceType("SINGLE_TABLE") * @ORM\DiscriminatorMap( * { * "generic" = "App\Entity\CreditPackGeneric", * "custom" = "App\Entity\CreditPackCustom", * "sms" = "App\Entity\SmsCreditPackGeneric", * "sms_custom" = "App\Entity\SmsCreditPackCustom" * }) */abstract class CreditPack implements LineItemInterface{ /** * @ORM\Id() * @ORM\GeneratedValue() * @ORM\Column(type="integer") */ protected $id; /** * @ORM\Column(type="decimal", precision=10, scale=2) */ protected $price; /** * @ORM\Column(type="integer") */ protected $nbProspects; /** * @ORM\Column(type="string", length=255) */ protected $name; /** * @ORM\Column(type="string", length=255) */ protected $description; public function getId(): ?int { return $this->id; } public function getPrice(): float { return $this->price; } public function setPrice(float $price): self { $this->price = $price; return $this; } public function getNbProspects(): ?int { return $this->nbProspects; } public function setNbProspects(int $nbProspects): self { $this->nbProspects = $nbProspects; return $this; } public function getImages(): array { return []; } public function getAmount(): float { return $this->getPrice(); } public function getQuantity(): int { return 1; } public function getFullPrice(): float{ return round($this->price + .2 * $this->price, 2); } public function getName(): string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getDescription(): string { return $this->description; } public function setDescription(string $description): self { $this->description = $description; return $this; } public function isCreditPack(){ return true; } public function isSmsCreditPack(){ return false; }}