class PurchaseCreditsService implements PurchaseCreditsServiceInterface

PurchaseCreditsService class

Properties

private ConfigServiceInterface $configService Stores ConfigServiceInterface
private EntityManagerInterface $em Stores EntityManagerInterface
private PurchaseCreditsEmailInterface $purchaseCreditsEmail Stores PurchaseCreditsEmailInterface
private PurchaseCreditsFormFactoryInterface $purchaseCreditsFormFactory Stores PurchaseCreditsFormFactoryInterface
private ServiceToolsInterface $serviceTools Stores ServiceToolsInterface
private Request $request Stores current Request
private TransactionServiceInterface $transactionService Stores TransactionServiceInterface
private TranslatorInterface $translator Stores TranslatorInterface

Methods

__construct(ConfigServiceInterface $configService, EntityManagerInterface $em, PurchaseCreditsEmailInterface $purchaseCreditsEmail, PurchaseCreditsFormFactoryInterface $purchaseCreditsFormFactory, ServiceToolsInterface $serviceTools, RequestStack $requestStack, TransactionServiceInterface $transactionService, TranslatorInterface $translator)

No description

create()

Creates the PurchaseCredits

Form
createForm(string $name, PurchaseCredits $purchaseCredits, int $credits, array $priceChoices)

Shortcut to call PurchaseCreditsFormFactory to create Form

array
getPrices()

Gets prices for credits

array
getPricesChoice()

Gets prices choice labels for credits

define(PurchaseCredits $purchaseCredits)

Registers the PurchaseCredits

bool
validate(Payment $payment)

Validate the credits purchased

Details

at line 80
__construct(ConfigServiceInterface $configService, EntityManagerInterface $em, PurchaseCreditsEmailInterface $purchaseCreditsEmail, PurchaseCreditsFormFactoryInterface $purchaseCreditsFormFactory, ServiceToolsInterface $serviceTools, RequestStack $requestStack, TransactionServiceInterface $transactionService, TranslatorInterface $translator)

Parameters

ConfigServiceInterface $configService
EntityManagerInterface $em
PurchaseCreditsEmailInterface $purchaseCreditsEmail
PurchaseCreditsFormFactoryInterface $purchaseCreditsFormFactory
ServiceToolsInterface $serviceTools
RequestStack $requestStack
TransactionServiceInterface $transactionService
TranslatorInterface $translator

at line 104
PurchaseCredits create()

Creates the PurchaseCredits

Return Value

PurchaseCredits

at line 117
Form createForm(string $name, PurchaseCredits $purchaseCredits, int $credits, array $priceChoices)

Shortcut to call PurchaseCreditsFormFactory to create Form

Parameters

string $name
PurchaseCredits $purchaseCredits
int $credits
array $priceChoices

Return Value

Form

at line 125
array getPrices()

Gets prices for credits

Return Value

array

Exceptions

InvalidArgumentException

at line 144
array getPricesChoice()

Gets prices choice labels for credits

Return Value

array

at line 166
define(PurchaseCredits $purchaseCredits)

Registers the PurchaseCredits

Parameters

PurchaseCredits $purchaseCredits

at line 177
bool validate(Payment $payment)

Validate the credits purchased

Parameters

Payment $payment

Return Value

bool