CardColorOption
in package
Variante de couleur proposée pour un modèle de carte {@see Card}, avec son propre supplément de prix.
Une carte porte zéro à plusieurs options de couleur ; chacune appartient à une carte unique
(jointure obligatoire). price est le supplément appliqué lorsque cette couleur est
sélectionnée, initialisé à '0.00' et jamais laissé à null : setPrice(null) ou
setPrice('') sont normalisés vers '0.00'. isActive (par défaut true) permet de
désactiver une couleur sans la supprimer, par exemple en cas de rupture de stock. Les
accesseurs isActive()/getIsActive() et setActive()/setIsActive() sont des alias
équivalents, ce dernier délégant à setActive().
Attributes
- #[Entity]
Table of Contents
Properties
- $card : Card|null
- $hexValue : string|null
- $id : int|null
- $isActive : bool|null
- $label : string|null
- $price : string|null
Methods
- getCard() : Card|null
- getHexValue() : string|null
- getId() : int|null
- getIsActive() : bool|null
- getLabel() : string|null
- getPrice() : string|null
- isActive() : bool|null
- setActive() : static
- setCard() : static
- setHexValue() : static
- setIsActive() : static
- setLabel() : static
- setPrice() : static
Properties
$card
private
Card|null
$card
= null
Attributes
- #[JoinColumn]
- $nullable: false
- #[ManyToOne]
- $inversedBy: 'colorOptions'
$hexValue
private
string|null
$hexValue
= null
Attributes
- #[Column]
- $length: 7
$id
private
int|null
$id
= null
Attributes
- #[Column]
- #[GeneratedValue]
- #[Id]
$isActive
private
bool|null
$isActive
= true
Attributes
- #[Column]
$label
private
string|null
$label
= null
Attributes
- #[Column]
- $length: 100
$price
private
string|null
$price
= '0.00'
Attributes
- #[Column]
- $type: \Doctrine\DBAL\Types\Types::DECIMAL
- $precision: 10
- $scale: 2
Methods
getCard()
public
getCard() : Card|null
Return values
Card|nullgetHexValue()
public
getHexValue() : string|null
Return values
string|nullgetId()
public
getId() : int|null
Return values
int|nullgetIsActive()
public
getIsActive() : bool|null
Return values
bool|nullgetLabel()
public
getLabel() : string|null
Return values
string|nullgetPrice()
public
getPrice() : string|null
Return values
string|nullisActive()
public
isActive() : bool|null
Return values
bool|nullsetActive()
public
setActive(bool $isActive) : static
Parameters
- $isActive : bool
Return values
staticsetCard()
public
setCard(Card|null $card) : static
Parameters
- $card : Card|null
Return values
staticsetHexValue()
public
setHexValue(string $hexValue) : static
Parameters
- $hexValue : string
Return values
staticsetIsActive()
public
setIsActive(bool $isActive) : static
Parameters
- $isActive : bool
Return values
staticsetLabel()
public
setLabel(string $label) : static
Parameters
- $label : string
Return values
staticsetPrice()
public
setPrice(string|null $price) : static
Parameters
- $price : string|null