PhysicalCard
in package
Commande d'impression et de livraison d'une carte de visite physique reprenant une carte virtuelle.
Une carte physique appartient à un utilisateur (User, obligatoire) et duplique le
contenu d'une carte virtuelle (BusinessCardAize, obligatoire) sur un modèle produit
(Card, obligatoire) avec, en option, un CardModel, une variante de couleur
(CardColorOption) et de finition (CardPrintOption), et un rattachement à une
Order. status prend l'une des valeurs PENDING, PENDING_PAYMENT, CONFIRMED,
PROCESSING, SHIPPED ou DELIVERED (constantes STATUS_*), initialisé à PENDING. Ces
noms suggèrent un déroulement logique dans cet ordre, mais aucune machine à états ne
l'impose : ni l'entité ni les contrôleurs ne valident les transitions. En particulier,
PhysicalCardApiController::updateStatus() (admin) accepte n'importe laquelle des valeurs
PENDING, PROCESSING, SHIPPED ou DELIVERED sans contrôle de l'état courant ni de
l'ordre — CONFIRMED et PENDING_PAYMENT n'y sont même pas proposées, elles ne sont
positionnées que par le flux de commande initial.
price est normalisé en chaîne décimale à deux décimales par setPrice(), qui accepte
indifféremment une chaîne (avec séparateurs ,/espaces tolérés), un entier ou un flottant.
customFrontImage, customBackImage, logoFile, frontText, backText et fontFamily
permettent une personnalisation de la carte distincte de celle de la carte virtuelle source ;
designerInstructions porte des consignes libres à destination de l'atelier d'impression.
Attributes
- #[Entity]
- $repositoryClass: \App\Repository\PhysicalCardRepository::class
Table of Contents
Constants
- STATUS_CONFIRMED : mixed = 'CONFIRMED'
- STATUS_DELIVERED : mixed = 'DELIVERED'
- STATUS_PENDING : mixed = 'PENDING'
- STATUS_PENDING_PAYMENT : mixed = 'PENDING_PAYMENT'
- STATUS_PROCESSING : mixed = 'PROCESSING'
- STATUS_SHIPPED : mixed = 'SHIPPED'
Properties
- $backText : string|null
- $cardModel : CardModel|null
- $cardProduct : Card|null
- $colorOption : CardColorOption|null
- $createdAt : DateTimeInterface|null
- $customBackImage : string|null
- $customFrontImage : string|null
- $designerInstructions : string|null
- $fontFamily : string|null
- $frontText : string|null
- $id : int|null
- $logoFile : string|null
- $order : Order|null
- $price : string|null
- $printOption : CardPrintOption|null
- $shippingAddress : string|null
- $status : string|null
- $updatedAt : DateTimeInterface|null
- $user : User|null
- $virtualCard : BusinessCardAize|null
Methods
- __construct() : mixed
- getBackText() : string|null
- getCardModel() : CardModel|null
- getCardProduct() : Card|null
- getColorOption() : CardColorOption|null
- getCreatedAt() : DateTimeInterface|null
- getCustomBackImage() : string|null
- getCustomFrontImage() : string|null
- getDesignerInstructions() : string|null
- getFontFamily() : string|null
- getFrontText() : string|null
- getId() : int|null
- getLogoFile() : string|null
- getOrder() : Order|null
- getPrice() : string|null
- getPrintOption() : CardPrintOption|null
- getShippingAddress() : string|null
- getStatus() : string|null
- getUpdatedAt() : DateTimeInterface|null
- getUser() : User|null
- getVirtualCard() : BusinessCardAize|null
- setBackText() : static
- setCardModel() : static
- setCardProduct() : static
- setColorOption() : static
- setCreatedAt() : static
- setCustomBackImage() : static
- setCustomFrontImage() : static
- setDesignerInstructions() : static
- setFontFamily() : static
- setFrontText() : static
- setLogoFile() : static
- setOrder() : static
- setPrice() : static
- setPrintOption() : static
- setShippingAddress() : static
- setStatus() : static
- setUpdatedAt() : static
- setUser() : static
- setVirtualCard() : static
Constants
STATUS_CONFIRMED
public
mixed
STATUS_CONFIRMED
= 'CONFIRMED'
STATUS_DELIVERED
public
mixed
STATUS_DELIVERED
= 'DELIVERED'
STATUS_PENDING
public
mixed
STATUS_PENDING
= 'PENDING'
STATUS_PENDING_PAYMENT
public
mixed
STATUS_PENDING_PAYMENT
= 'PENDING_PAYMENT'
STATUS_PROCESSING
public
mixed
STATUS_PROCESSING
= 'PROCESSING'
STATUS_SHIPPED
public
mixed
STATUS_SHIPPED
= 'SHIPPED'
Properties
$backText
private
string|null
$backText
= null
Attributes
- #[Column]
- $type: 'text'
- $nullable: true
$cardModel
private
CardModel|null
$cardModel
= null
Attributes
- #[JoinColumn]
- $nullable: true
- #[ManyToOne]
- $targetEntity: \App\Entity\CardModel::class
$cardProduct
private
Card|null
$cardProduct
= null
Attributes
- #[JoinColumn]
- $nullable: false
- #[ManyToOne]
- $targetEntity: \App\Entity\Card::class
$colorOption
private
CardColorOption|null
$colorOption
= null
Attributes
- #[JoinColumn]
- $nullable: true
- #[ManyToOne]
$createdAt
private
DateTimeInterface|null
$createdAt
= null
Attributes
- #[Column]
- $type: 'datetime'
$customBackImage
private
string|null
$customBackImage
= null
Attributes
- #[Column]
- $length: 255
- $nullable: true
$customFrontImage
private
string|null
$customFrontImage
= null
Attributes
- #[Column]
- $length: 255
- $nullable: true
$designerInstructions
private
string|null
$designerInstructions
= null
Attributes
- #[Column]
- $type: 'text'
- $nullable: true
$fontFamily
private
string|null
$fontFamily
= null
Attributes
- #[Column]
- $length: 100
- $nullable: true
$frontText
private
string|null
$frontText
= null
Attributes
- #[Column]
- $type: 'text'
- $nullable: true
$id
private
int|null
$id
= null
Attributes
- #[Column]
- #[GeneratedValue]
- #[Id]
$logoFile
private
string|null
$logoFile
= null
Attributes
- #[Column]
- $length: 255
- $nullable: true
$order
private
Order|null
$order
= null
Attributes
- #[JoinColumn]
- $nullable: true
- #[ManyToOne]
- $targetEntity: \App\Entity\Order::class
$price
private
string|null
$price
= null
Attributes
- #[Column]
- $type: 'decimal'
- $precision: 10
- $scale: 2
- $nullable: true
$printOption
private
CardPrintOption|null
$printOption
= null
Attributes
- #[JoinColumn]
- $nullable: true
- #[ManyToOne]
$shippingAddress
private
string|null
$shippingAddress
= null
Attributes
- #[Column]
- $length: 255
- $nullable: true
$status
private
string|null
$status
= self::STATUS_PENDING
Attributes
- #[Column]
- $length: 50
$updatedAt
private
DateTimeInterface|null
$updatedAt
= null
Attributes
- #[Column]
- $type: 'datetime'
- $nullable: true
$user
private
User|null
$user
= null
Attributes
- #[JoinColumn]
- $nullable: false
- #[ManyToOne]
- $targetEntity: \App\Entity\User::class
$virtualCard
private
BusinessCardAize|null
$virtualCard
= null
Attributes
- #[JoinColumn]
- $nullable: false
- #[ManyToOne]
- $targetEntity: \App\Entity\BusinessCardAize::class
Methods
__construct()
public
__construct() : mixed
getBackText()
public
getBackText() : string|null
Return values
string|nullgetCardModel()
public
getCardModel() : CardModel|null
Return values
CardModel|nullgetCardProduct()
public
getCardProduct() : Card|null
Return values
Card|nullgetColorOption()
public
getColorOption() : CardColorOption|null
Return values
CardColorOption|nullgetCreatedAt()
public
getCreatedAt() : DateTimeInterface|null
Return values
DateTimeInterface|nullgetCustomBackImage()
public
getCustomBackImage() : string|null
Return values
string|nullgetCustomFrontImage()
public
getCustomFrontImage() : string|null
Return values
string|nullgetDesignerInstructions()
public
getDesignerInstructions() : string|null
Return values
string|nullgetFontFamily()
public
getFontFamily() : string|null
Return values
string|nullgetFrontText()
public
getFrontText() : string|null
Return values
string|nullgetId()
public
getId() : int|null
Return values
int|nullgetLogoFile()
public
getLogoFile() : string|null
Return values
string|nullgetOrder()
public
getOrder() : Order|null
Return values
Order|nullgetPrice()
public
getPrice() : string|null
Return values
string|nullgetPrintOption()
public
getPrintOption() : CardPrintOption|null
Return values
CardPrintOption|nullgetShippingAddress()
public
getShippingAddress() : string|null
Return values
string|nullgetStatus()
public
getStatus() : string|null
Return values
string|nullgetUpdatedAt()
public
getUpdatedAt() : DateTimeInterface|null
Return values
DateTimeInterface|nullgetUser()
public
getUser() : User|null
Return values
User|nullgetVirtualCard()
public
getVirtualCard() : BusinessCardAize|null
Return values
BusinessCardAize|nullsetBackText()
public
setBackText(string|null $backText) : static
Parameters
- $backText : string|null
Return values
staticsetCardModel()
public
setCardModel(CardModel|null $cardModel) : static
Parameters
- $cardModel : CardModel|null
Return values
staticsetCardProduct()
public
setCardProduct(Card|null $cardProduct) : static
Parameters
- $cardProduct : Card|null
Return values
staticsetColorOption()
public
setColorOption(CardColorOption|null $colorOption) : static
Parameters
- $colorOption : CardColorOption|null
Return values
staticsetCreatedAt()
public
setCreatedAt(DateTimeInterface $createdAt) : static
Parameters
- $createdAt : DateTimeInterface
Return values
staticsetCustomBackImage()
public
setCustomBackImage(string|null $customBackImage) : static
Parameters
- $customBackImage : string|null
Return values
staticsetCustomFrontImage()
public
setCustomFrontImage(string|null $customFrontImage) : static
Parameters
- $customFrontImage : string|null
Return values
staticsetDesignerInstructions()
public
setDesignerInstructions(string|null $designerInstructions) : static
Parameters
- $designerInstructions : string|null
Return values
staticsetFontFamily()
public
setFontFamily(string|null $fontFamily) : static
Parameters
- $fontFamily : string|null
Return values
staticsetFrontText()
public
setFrontText(string|null $frontText) : static
Parameters
- $frontText : string|null
Return values
staticsetLogoFile()
public
setLogoFile(string|null $logoFile) : static
Parameters
- $logoFile : string|null
Return values
staticsetOrder()
public
setOrder(Order|null $order) : static
Parameters
- $order : Order|null
Return values
staticsetPrice()
public
setPrice(string|float|int|null $price) : static
Parameters
- $price : string|float|int|null
Return values
staticsetPrintOption()
public
setPrintOption(CardPrintOption|null $printOption) : static
Parameters
- $printOption : CardPrintOption|null
Return values
staticsetShippingAddress()
public
setShippingAddress(string|null $shippingAddress) : static
Parameters
- $shippingAddress : string|null
Return values
staticsetStatus()
public
setStatus(string $status) : static
Parameters
- $status : string
Return values
staticsetUpdatedAt()
public
setUpdatedAt(DateTimeInterface $updatedAt) : static
Parameters
- $updatedAt : DateTimeInterface
Return values
staticsetUser()
public
setUser(User|null $user) : static
Parameters
- $user : User|null
Return values
staticsetVirtualCard()
public
setVirtualCard(BusinessCardAize|null $virtualCard) : static
Parameters
- $virtualCard : BusinessCardAize|null