Plan
in package
Offre d'abonnement (plan tarifaire) proposée aux utilisateurs et aux entreprises.
Porte les tarifs mensuel et annuel (monthlyPrice, yearlyPrice, décimaux), la liste des
clés de fonctionnalités incluses (features, JSON — voir getFeaturesLabels() qui les
traduit en libellés depuis une table de correspondance codée en dur dans cette classe), le
nombre de cartes comprises (cardsIncluded, null ou 0 traités comme illimité par le code
appelant) et le tarif d'une carte supplémentaire (additionalCardPrice). isActive contrôle
la visibilité du plan, popular et badge sa mise en avant dans la grille tarifaire, et
sortOrder son rang d'affichage.
Relation : plusieurs Subscription souscrivent ce plan (subscriptions, one-to-many).
getFormattedMonthlyPrice() et getFormattedYearlyPrice() formatent le tarif en francs
guinéens (GNF) ; getYearlyDiscount() calcule, en pourcentage entier, la remise du tarif
annuel par rapport à douze fois le tarif mensuel.
Attributes
- #[Entity]
- $repositoryClass: \App\Repository\PlanRepository::class
Table of Contents
Properties
- $additionalCardPrice : string|null
- $badge : string|null
- $cardsIncluded : int|null
- $createdAt : DateTimeImmutable|null
- $description : string|null
- $features : array<string|int, mixed>|null
- $id : int|null
- $isActive : bool|null
- $monthlyPrice : string|null
- $name : string|null
- $popular : bool|null
- $sortOrder : int|null
- $subscriptions : Collection<int, Subscription>
- $updatedAt : DateTimeImmutable|null
- $yearlyPrice : string|null
Methods
- __construct() : mixed
- addSubscription() : static
- getAdditionalCardPrice() : string|null
- getBadge() : string|null
- getCardsIncluded() : int|null
- getCreatedAt() : DateTimeImmutable|null
- getDescription() : string|null
- getFeatures() : array<string|int, mixed>|null
- getFeaturesLabels() : array<string|int, mixed>
- Retourne les labels des fonctionnalités pour l'affichage
- getFormattedMonthlyPrice() : string
- getFormattedYearlyPrice() : string
- getId() : int|null
- getMonthlyPrice() : string|null
- getName() : string|null
- getSortOrder() : int|null
- getSubscriptions() : Collection<int, Subscription>
- getUpdatedAt() : DateTimeImmutable|null
- getYearlyDiscount() : int
- getYearlyPrice() : string|null
- isActive() : bool|null
- isPopular() : bool|null
- removeSubscription() : static
- setActive() : static
- setAdditionalCardPrice() : static
- setBadge() : static
- setCardsIncluded() : static
- setCreatedAt() : static
- setDescription() : static
- setFeatures() : static
- setMonthlyPrice() : static
- setName() : static
- setPopular() : static
- setSortOrder() : static
- setUpdatedAt() : static
- setYearlyPrice() : static
Properties
$additionalCardPrice
private
string|null
$additionalCardPrice
= null
Attributes
- #[Column]
- $type: \Doctrine\DBAL\Types\Types::DECIMAL
- $precision: 10
- $scale: 2
- $nullable: true
$badge
private
string|null
$badge
= null
Attributes
- #[Column]
- $length: 50
- $nullable: true
$cardsIncluded
private
int|null
$cardsIncluded
= null
Attributes
- #[Column]
- $nullable: true
$createdAt
private
DateTimeImmutable|null
$createdAt
= null
Attributes
- #[Column]
$description
private
string|null
$description
= null
Attributes
- #[Column]
- $length: 255
- $nullable: true
$features
private
array<string|int, mixed>|null
$features
= null
Attributes
- #[Column]
- $type: \Doctrine\DBAL\Types\Types::JSON
- $nullable: true
$id
private
int|null
$id
= null
Attributes
- #[Column]
- #[GeneratedValue]
- #[Id]
$isActive
private
bool|null
$isActive
= true
Attributes
- #[Column]
$monthlyPrice
private
string|null
$monthlyPrice
= null
Attributes
- #[Column]
- $type: \Doctrine\DBAL\Types\Types::DECIMAL
- $precision: 10
- $scale: 2
$name
private
string|null
$name
= null
Attributes
- #[Column]
- $length: 100
$popular
private
bool|null
$popular
= false
Attributes
- #[Column]
$sortOrder
private
int|null
$sortOrder
= 0
Attributes
- #[Column]
$subscriptions
private
Collection<int, Subscription>
$subscriptions
Attributes
- #[OneToMany]
- $targetEntity: \App\Entity\Subscription::class
- $mappedBy: 'plan'
$updatedAt
private
DateTimeImmutable|null
$updatedAt
= null
Attributes
- #[Column]
$yearlyPrice
private
string|null
$yearlyPrice
= null
Attributes
- #[Column]
- $type: \Doctrine\DBAL\Types\Types::DECIMAL
- $precision: 10
- $scale: 2
Methods
__construct()
public
__construct() : mixed
addSubscription()
public
addSubscription(Subscription $subscription) : static
Parameters
- $subscription : Subscription
Return values
staticgetAdditionalCardPrice()
public
getAdditionalCardPrice() : string|null
Return values
string|nullgetBadge()
public
getBadge() : string|null
Return values
string|nullgetCardsIncluded()
public
getCardsIncluded() : int|null
Return values
int|nullgetCreatedAt()
public
getCreatedAt() : DateTimeImmutable|null
Return values
DateTimeImmutable|nullgetDescription()
public
getDescription() : string|null
Return values
string|nullgetFeatures()
public
getFeatures() : array<string|int, mixed>|null
Return values
array<string|int, mixed>|nullgetFeaturesLabels()
Retourne les labels des fonctionnalités pour l'affichage
public
getFeaturesLabels() : array<string|int, mixed>
Return values
array<string|int, mixed>getFormattedMonthlyPrice()
public
getFormattedMonthlyPrice() : string
Return values
stringgetFormattedYearlyPrice()
public
getFormattedYearlyPrice() : string
Return values
stringgetId()
public
getId() : int|null
Return values
int|nullgetMonthlyPrice()
public
getMonthlyPrice() : string|null
Return values
string|nullgetName()
public
getName() : string|null
Return values
string|nullgetSortOrder()
public
getSortOrder() : int|null
Return values
int|nullgetSubscriptions()
public
getSubscriptions() : Collection<int, Subscription>
Return values
Collection<int, Subscription>getUpdatedAt()
public
getUpdatedAt() : DateTimeImmutable|null
Return values
DateTimeImmutable|nullgetYearlyDiscount()
public
getYearlyDiscount() : int
Return values
intgetYearlyPrice()
public
getYearlyPrice() : string|null
Return values
string|nullisActive()
public
isActive() : bool|null
Return values
bool|nullisPopular()
public
isPopular() : bool|null
Return values
bool|nullremoveSubscription()
public
removeSubscription(Subscription $subscription) : static
Parameters
- $subscription : Subscription
Return values
staticsetActive()
public
setActive(bool $isActive) : static
Parameters
- $isActive : bool
Return values
staticsetAdditionalCardPrice()
public
setAdditionalCardPrice(string|null $additionalCardPrice) : static
Parameters
- $additionalCardPrice : string|null
Return values
staticsetBadge()
public
setBadge(string|null $badge) : static
Parameters
- $badge : string|null
Return values
staticsetCardsIncluded()
public
setCardsIncluded(int|null $cardsIncluded) : static
Parameters
- $cardsIncluded : int|null
Return values
staticsetCreatedAt()
public
setCreatedAt(DateTimeImmutable $createdAt) : static
Parameters
- $createdAt : DateTimeImmutable
Return values
staticsetDescription()
public
setDescription(string|null $description) : static
Parameters
- $description : string|null
Return values
staticsetFeatures()
public
setFeatures(array<string|int, mixed>|null $features) : static
Parameters
- $features : array<string|int, mixed>|null
Return values
staticsetMonthlyPrice()
public
setMonthlyPrice(string $monthlyPrice) : static
Parameters
- $monthlyPrice : string
Return values
staticsetName()
public
setName(string $name) : static
Parameters
- $name : string
Return values
staticsetPopular()
public
setPopular(bool $isPopular) : static
Parameters
- $isPopular : bool
Return values
staticsetSortOrder()
public
setSortOrder(int $sortOrder) : static
Parameters
- $sortOrder : int
Return values
staticsetUpdatedAt()
public
setUpdatedAt(DateTimeImmutable $updatedAt) : static
Parameters
- $updatedAt : DateTimeImmutable
Return values
staticsetYearlyPrice()
public
setYearlyPrice(string $yearlyPrice) : static
Parameters
- $yearlyPrice : string