BusinessCardAize
in package
Carte de visite numérique (carte virtuelle) d'un utilisateur ou d'un employé.
Malgré son nom, cette entité porte l'ensemble des informations affichées sur une carte de
visite BCard : identité, coordonnées, réseaux sociaux, image, logo, couleurs, numéros de
téléphone multiples (phoneNumbers, au format JSON, chacun avec sa visibilité propre) et
activités professionnelles liées (Activity). Elle appartient à un User (many-to-one,
propriétaire optionnel) et peut référencer un Card du catalogue de cartes physiques/NFC
(many-to-one) ainsi qu'un Employee (one-to-one, quand la carte est celle d'un salarié
d'entreprise plutôt que celle d'un utilisateur individuel).
Le statut (status) suit trois valeurs constantes — STATUS_DRAFT, STATUS_PUBLISHED,
STATUS_DISABLED — et est manipulé via publish(), setAsDraft() et disable(). Le logo
personnalisé et les couleurs personnalisées ne sont effectivement affichés
(getDisplayLogo()) que si l'utilisateur associé a accès aux fonctionnalités premium
(User::hasAccessToPremiumFeatures()) : canUseCustomLogo() et canUseCustomColors()
encapsulent cette règle.
getPhoneNumbers() retombe sur le champ historique phoneNumber si phoneNumbers est vide,
pour compatibilité avec les cartes créées avant l'introduction des numéros multiples ;
getVisiblePhoneNumbers() n'en retourne que les numéros marqués visibles.
Groupes de sérialisation exposés à l'API : businessCard:read (la quasi-totalité des champs,
y compris emailSentAt) et businessCard:write (les mêmes, hors emailSentAt). country
n'appartient à aucun des deux groupes et n'est donc pas exposé par le sérialiseur API.
Attributes
- #[Entity]
- $repositoryClass: \App\Repository\BusinessCardAizeRepository::class
- #[UniqueConstraint]
- $name: 'UNIQ_IDENTIFIER_EMAIL'
- $fields: ['email', 'phoneNumber']
- #[UniqueEntity]
- $fields: ['email']
- $message: 'Une carte existe dejà avec cet email'
- #[UniqueEntity]
- $fields: ['phoneNumber']
- $message: 'Une carte existe dejà avec cet numéro de téléphone'
Table of Contents
Constants
- STATUS_DISABLED : mixed = 'disabled'
- STATUS_DRAFT : mixed = 'draft'
- STATUS_PUBLISHED : mixed = 'published'
Properties
- $activities : Collection<int, Activity>
- $additionalInfo : string|null
- $address : string|null
- $bio : string|null
- $card : Card|null
- $company : string|null
- $country : string|null
- $createdAt : DateTimeImmutable|null
- $customLogo : string|null
- $cv : string|null
- $email : string|null
- $emailSentAt : DateTimeImmutable|null
- $employee : Employee|null
- $facebook : string|null
- $firstName : string|null
- $id : int|null
- $image : string|null
- $industry : string|null
- $instagram : string|null
- $jobTitle : string|null
- $lastName : string|null
- $linkedin : string|null
- $organizationType : string|null
- $phoneNumber : string|null
- $phoneNumbers : array<string|int, mixed>|null
- $primaryColor : string|null
- $publicHash : string|null
- $qrCodePath : string|null
- $secondaryColor : string|null
- $shareInNetwork : bool
- $skills : array<string|int, mixed>|null
- $status : string
- $twitter : string|null
- $user : User|null
- $website : string|null
Methods
- __construct() : mixed
- addActivity() : static
- canUseCustomColors() : bool
- Vérifie si l'utilisateur peut utiliser des couleurs personnalisées (offre Pro)
- canUseCustomLogo() : bool
- Vérifie si l'utilisateur peut utiliser un logo personnalisé (offre Pro)
- disable() : static
- getActivities() : Collection<int, Activity>
- getAdditionalInfo() : string|null
- getAddress() : string|null
- getBio() : string|null
- getCard() : Card|null
- getCompany() : string|null
- getCountry() : string|null
- getCreatedAt() : DateTimeImmutable|null
- getCustomLogo() : string|null
- getCv() : string|null
- getDisplayLogo() : string|null
- Retourne le logo à afficher (personnalisé si disponible, sinon logo par défaut)
- getEmail() : string|null
- getEmailSentAt() : DateTimeImmutable|null
- getEmployee() : Employee|null
- getFacebook() : string|null
- getFirstName() : string|null
- getId() : int|null
- getImage() : string|null
- getIndustry() : string|null
- getInstagram() : string|null
- getJobTitle() : string|null
- getLastName() : string|null
- getLinkedin() : string|null
- getOrganizationType() : string|null
- getPhoneNumber() : string|null
- getPhoneNumbers() : array<string|int, mixed>
- getPrimaryColor() : string|null
- getPublicHash() : string|null
- getQrCodePath() : string|null
- getSecondaryColor() : string|null
- getSkills() : array<string|int, mixed>
- getStatus() : string
- getTwitter() : string|null
- getUser() : User|null
- getVisiblePhoneNumbers() : array<string|int, mixed>
- getWebsite() : string|null
- isDisabled() : bool
- isDraft() : bool
- isPublished() : bool
- isShareInNetwork() : bool
- markEmailAsSent() : static
- publish() : static
- removeActivity() : static
- setAdditionalInfo() : static
- setAddress() : static
- setAsDraft() : static
- setBio() : static
- setCard() : static
- setCompany() : static
- setCountry() : static
- setCreatedAt() : static
- setCustomLogo() : static
- setCv() : static
- setEmail() : static
- setEmailSentAt() : static
- setEmployee() : static
- setFacebook() : static
- setFirstName() : static
- setImage() : static
- setIndustry() : static
- setInstagram() : static
- setJobTitle() : static
- setLastName() : static
- setLinkedin() : static
- setOrganizationType() : static
- setPhoneNumber() : static
- setPhoneNumbers() : static
- setPrimaryColor() : static
- setPublicHash() : static
- setQrCodePath() : static
- setSecondaryColor() : static
- setShareInNetwork() : static
- setSkills() : static
- setStatus() : static
- setTwitter() : static
- setUser() : static
- setWebsite() : static
- normalizePhoneNumbers() : array<string|int, mixed>
Constants
STATUS_DISABLED
public
mixed
STATUS_DISABLED
= 'disabled'
STATUS_DRAFT
public
mixed
STATUS_DRAFT
= 'draft'
STATUS_PUBLISHED
public
mixed
STATUS_PUBLISHED
= 'published'
Properties
$activities
private
Collection<int, Activity>
$activities
Attributes
- #[OneToMany]
- $targetEntity: \App\Entity\Activity::class
- $mappedBy: 'businessCardAize'
- $cascade: ['persist', 'remove']
- $orphanRemoval: true
$additionalInfo
private
string|null
$additionalInfo
= null
Attributes
- #[Column]
- $length: 255
- $nullable: true
- #[Groups]
- ['businessCard:read', 'businessCard:write']
$address
private
string|null
$address
= null
Attributes
- #[Column]
- $length: 255
- $nullable: true
- #[Groups]
- ['businessCard:read', 'businessCard:write']
$bio
private
string|null
$bio
= null
Attributes
- #[Column]
- $length: 255
- $nullable: true
- #[Groups]
- ['businessCard:read', 'businessCard:write']
$card
private
Card|null
$card
= null
Attributes
- #[ManyToOne]
- $inversedBy: 'businessCardAizes'
$company
private
string|null
$company
= null
Attributes
- #[Column]
- $length: 255
- $nullable: true
- #[Groups]
- ['businessCard:read', 'businessCard:write']
$country
private
string|null
$country
= null
Attributes
- #[Column]
- $length: 255
- $nullable: true
$createdAt
private
DateTimeImmutable|null
$createdAt
= null
Attributes
- #[Column]
- $nullable: true
- #[Groups]
- ['businessCard:read', 'businessCard:write']
$customLogo
private
string|null
$customLogo
= null
Attributes
- #[Column]
- $length: 255
- $nullable: true
- #[Groups]
- ['businessCard:read', 'businessCard:write']
$cv
private
string|null
$cv
= null
Attributes
- #[Column]
- $length: 255
- $nullable: true
- #[Groups]
- ['businessCard:read', 'businessCard:write']
private
string|null
$email
= null
Attributes
- #[Column]
- $length: 255
- #[Groups]
- ['businessCard:read', 'businessCard:write']
$emailSentAt
private
DateTimeImmutable|null
$emailSentAt
= null
Attributes
- #[Column]
- $nullable: true
- #[Groups]
- ['businessCard:read']
$employee
private
Employee|null
$employee
= null
Attributes
- #[JoinColumn]
- $nullable: true
- #[OneToOne]
- $inversedBy: 'businessCard'
private
string|null
$facebook
= null
Attributes
- #[Column]
- $length: 255
- $nullable: true
- #[Groups]
- ['businessCard:read', 'businessCard:write']
$firstName
private
string|null
$firstName
= null
Attributes
- #[Column]
- $length: 255
- #[Groups]
- ['businessCard:read', 'businessCard:write']
$id
private
int|null
$id
= null
Attributes
- #[Column]
- #[GeneratedValue]
- #[Id]
$image
private
string|null
$image
= null
Attributes
- #[Column]
- $length: 255
- $nullable: true
- #[Groups]
- ['businessCard:read', 'businessCard:write']
$industry
private
string|null
$industry
= null
Attributes
- #[Column]
- $length: 255
- $nullable: true
- #[Groups]
- ['businessCard:read', 'businessCard:write']
private
string|null
$instagram
= null
Attributes
- #[Column]
- $length: 255
- $nullable: true
- #[Groups]
- ['businessCard:read', 'businessCard:write']
$jobTitle
private
string|null
$jobTitle
= null
Attributes
- #[Column]
- $length: 255
- $nullable: true
- #[Groups]
- ['businessCard:read', 'businessCard:write']
$lastName
private
string|null
$lastName
= null
Attributes
- #[Column]
- $length: 255
- #[Groups]
- ['businessCard:read', 'businessCard:write']
private
string|null
$linkedin
= null
Attributes
- #[Column]
- $length: 255
- $nullable: true
- #[Groups]
- ['businessCard:read', 'businessCard:write']
$organizationType
private
string|null
$organizationType
= null
Attributes
- #[Column]
- $length: 255
- $nullable: true
- #[Groups]
- ['businessCard:read', 'businessCard:write']
$phoneNumber
private
string|null
$phoneNumber
= null
Attributes
- #[Column]
- $length: 255
- #[Groups]
- ['businessCard:read', 'businessCard:write']
$phoneNumbers
private
array<string|int, mixed>|null
$phoneNumbers
= []
Attributes
- #[Column]
- $type: \Doctrine\DBAL\Types\Types::JSON
- $nullable: true
- #[Groups]
- ['businessCard:read', 'businessCard:write']
$primaryColor
private
string|null
$primaryColor
= null
Attributes
- #[Column]
- $length: 7
- $nullable: true
- #[Groups]
- ['businessCard:read', 'businessCard:write']
$publicHash
private
string|null
$publicHash
= null
Attributes
- #[Column]
- $name: 'public_hash'
- $length: 64
- $unique: true
- $nullable: true
$qrCodePath
private
string|null
$qrCodePath
= null
Attributes
- #[Column]
- $length: 255
- $nullable: true
- #[Groups]
- ['businessCard:read', 'businessCard:write']
$secondaryColor
private
string|null
$secondaryColor
= null
Attributes
- #[Column]
- $length: 7
- $nullable: true
- #[Groups]
- ['businessCard:read', 'businessCard:write']
$shareInNetwork
private
bool
$shareInNetwork
= true
Attributes
- #[Column]
- $options: ['default' => true]
$skills
private
array<string|int, mixed>|null
$skills
= []
Attributes
- #[Column]
- $type: \Doctrine\DBAL\Types\Types::JSON
- $nullable: true
- #[Groups]
- ['businessCard:read', 'businessCard:write']
$status
private
string
$status
= 'draft'
Attributes
- #[Column]
- $length: 20
- $options: ['default' => 'draft']
- #[Groups]
- ['businessCard:read', 'businessCard:write']
private
string|null
$twitter
= null
Attributes
- #[Column]
- $length: 255
- $nullable: true
- #[Groups]
- ['businessCard:read', 'businessCard:write']
$user
private
User|null
$user
= null
Attributes
- #[ManyToOne]
- $inversedBy: 'businessCardAizes'
$website
private
string|null
$website
= null
Attributes
- #[Column]
- $length: 255
- $nullable: true
- #[Groups]
- ['businessCard:read', 'businessCard:write']
Methods
__construct()
public
__construct() : mixed
addActivity()
public
addActivity(Activity $activity) : static
Parameters
- $activity : Activity
Return values
staticcanUseCustomColors()
Vérifie si l'utilisateur peut utiliser des couleurs personnalisées (offre Pro)
public
canUseCustomColors() : bool
Return values
boolcanUseCustomLogo()
Vérifie si l'utilisateur peut utiliser un logo personnalisé (offre Pro)
public
canUseCustomLogo() : bool
Return values
booldisable()
public
disable() : static
Return values
staticgetActivities()
public
getActivities() : Collection<int, Activity>
Return values
Collection<int, Activity>getAdditionalInfo()
public
getAdditionalInfo() : string|null
Return values
string|nullgetAddress()
public
getAddress() : string|null
Return values
string|nullgetBio()
public
getBio() : string|null
Return values
string|nullgetCard()
public
getCard() : Card|null
Return values
Card|nullgetCompany()
public
getCompany() : string|null
Return values
string|nullgetCountry()
public
getCountry() : string|null
Return values
string|nullgetCreatedAt()
public
getCreatedAt() : DateTimeImmutable|null
Return values
DateTimeImmutable|nullgetCustomLogo()
public
getCustomLogo() : string|null
Return values
string|nullgetCv()
public
getCv() : string|null
Return values
string|nullgetDisplayLogo()
Retourne le logo à afficher (personnalisé si disponible, sinon logo par défaut)
public
getDisplayLogo() : string|null
Return values
string|nullgetEmail()
public
getEmail() : string|null
Return values
string|nullgetEmailSentAt()
public
getEmailSentAt() : DateTimeImmutable|null
Return values
DateTimeImmutable|nullgetEmployee()
public
getEmployee() : Employee|null
Return values
Employee|nullgetFacebook()
public
getFacebook() : string|null
Return values
string|nullgetFirstName()
public
getFirstName() : string|null
Return values
string|nullgetId()
public
getId() : int|null
Return values
int|nullgetImage()
public
getImage() : string|null
Return values
string|nullgetIndustry()
public
getIndustry() : string|null
Return values
string|nullgetInstagram()
public
getInstagram() : string|null
Return values
string|nullgetJobTitle()
public
getJobTitle() : string|null
Return values
string|nullgetLastName()
public
getLastName() : string|null
Return values
string|nullgetLinkedin()
public
getLinkedin() : string|null
Return values
string|nullgetOrganizationType()
public
getOrganizationType() : string|null
Return values
string|nullgetPhoneNumber()
public
getPhoneNumber() : string|null
Return values
string|nullgetPhoneNumbers()
public
getPhoneNumbers() : array<string|int, mixed>
Return values
array<string|int, mixed>getPrimaryColor()
public
getPrimaryColor() : string|null
Return values
string|nullgetPublicHash()
public
getPublicHash() : string|null
Return values
string|nullgetQrCodePath()
public
getQrCodePath() : string|null
Return values
string|nullgetSecondaryColor()
public
getSecondaryColor() : string|null
Return values
string|nullgetSkills()
public
getSkills() : array<string|int, mixed>
Return values
array<string|int, mixed>getStatus()
public
getStatus() : string
Return values
stringgetTwitter()
public
getTwitter() : string|null
Return values
string|nullgetUser()
public
getUser() : User|null
Return values
User|nullgetVisiblePhoneNumbers()
public
getVisiblePhoneNumbers() : array<string|int, mixed>
Return values
array<string|int, mixed>getWebsite()
public
getWebsite() : string|null
Return values
string|nullisDisabled()
public
isDisabled() : bool
Return values
boolisDraft()
public
isDraft() : bool
Return values
boolisPublished()
public
isPublished() : bool
Return values
boolisShareInNetwork()
public
isShareInNetwork() : bool
Return values
boolmarkEmailAsSent()
public
markEmailAsSent() : static
Return values
staticpublish()
public
publish() : static
Return values
staticremoveActivity()
public
removeActivity(Activity $activity) : static
Parameters
- $activity : Activity
Return values
staticsetAdditionalInfo()
public
setAdditionalInfo(string|null $additionalInfo) : static
Parameters
- $additionalInfo : string|null
Return values
staticsetAddress()
public
setAddress(string|null $address) : static
Parameters
- $address : string|null
Return values
staticsetAsDraft()
public
setAsDraft() : static
Return values
staticsetBio()
public
setBio(string|null $bio) : static
Parameters
- $bio : string|null
Return values
staticsetCard()
public
setCard(Card|null $card) : static
Parameters
- $card : Card|null
Return values
staticsetCompany()
public
setCompany(string|null $company) : static
Parameters
- $company : string|null
Return values
staticsetCountry()
public
setCountry(string|null $country) : static
Parameters
- $country : string|null
Return values
staticsetCreatedAt()
public
setCreatedAt(DateTimeImmutable $createdAt) : static
Parameters
- $createdAt : DateTimeImmutable
Return values
staticsetCustomLogo()
public
setCustomLogo(string|null $customLogo) : static
Parameters
- $customLogo : string|null
Return values
staticsetCv()
public
setCv(string|null $cv) : static
Parameters
- $cv : string|null
Return values
staticsetEmail()
public
setEmail(string $email) : static
Parameters
- $email : string
Return values
staticsetEmailSentAt()
public
setEmailSentAt(DateTimeImmutable|null $emailSentAt) : static
Parameters
- $emailSentAt : DateTimeImmutable|null
Return values
staticsetEmployee()
public
setEmployee(Employee|null $employee) : static
Parameters
- $employee : Employee|null
Return values
staticsetFacebook()
public
setFacebook(string|null $facebook) : static
Parameters
- $facebook : string|null
Return values
staticsetFirstName()
public
setFirstName(string $firstName) : static
Parameters
- $firstName : string
Return values
staticsetImage()
public
setImage(string|null $image) : static
Parameters
- $image : string|null
Return values
staticsetIndustry()
public
setIndustry(string|null $industry) : static
Parameters
- $industry : string|null
Return values
staticsetInstagram()
public
setInstagram(string|null $instagram) : static
Parameters
- $instagram : string|null
Return values
staticsetJobTitle()
public
setJobTitle(string|null $jobTitle) : static
Parameters
- $jobTitle : string|null
Return values
staticsetLastName()
public
setLastName(string $lastName) : static
Parameters
- $lastName : string
Return values
staticsetLinkedin()
public
setLinkedin(string|null $linkedin) : static
Parameters
- $linkedin : string|null
Return values
staticsetOrganizationType()
public
setOrganizationType(string|null $organizationType) : static
Parameters
- $organizationType : string|null
Return values
staticsetPhoneNumber()
public
setPhoneNumber(string $phoneNumber) : static
Parameters
- $phoneNumber : string
Return values
staticsetPhoneNumbers()
public
setPhoneNumbers(array<string|int, mixed>|null $phoneNumbers) : static
Parameters
- $phoneNumbers : array<string|int, mixed>|null
Return values
staticsetPrimaryColor()
public
setPrimaryColor(string|null $primaryColor) : static
Parameters
- $primaryColor : string|null
Return values
staticsetPublicHash()
public
setPublicHash(string|null $publicHash) : static
Parameters
- $publicHash : string|null
Return values
staticsetQrCodePath()
public
setQrCodePath(string $qrCodePath) : static
Parameters
- $qrCodePath : string
Return values
staticsetSecondaryColor()
public
setSecondaryColor(string|null $secondaryColor) : static
Parameters
- $secondaryColor : string|null
Return values
staticsetShareInNetwork()
public
setShareInNetwork(bool $shareInNetwork) : static
Parameters
- $shareInNetwork : bool
Return values
staticsetSkills()
public
setSkills(array<string|int, mixed>|null $skills) : static
Parameters
- $skills : array<string|int, mixed>|null
Return values
staticsetStatus()
public
setStatus(string $status) : static
Parameters
- $status : string
Return values
staticsetTwitter()
public
setTwitter(string|null $twitter) : static
Parameters
- $twitter : string|null
Return values
staticsetUser()
public
setUser(User|null $user) : static
Parameters
- $user : User|null
Return values
staticsetWebsite()
public
setWebsite(string|null $website) : static
Parameters
- $website : string|null
Return values
staticnormalizePhoneNumbers()
private
normalizePhoneNumbers(array<string|int, mixed> $phoneNumbers) : array<string|int, mixed>
Parameters
- $phoneNumbers : array<string|int, mixed>