BCard - Documentation technique

Company
in package

Entreprise cliente, porteuse de ses utilisateurs, employés, abonnements et paiements.

Relations : plusieurs User (users, one-to-many), plusieurs Employee (employees, one-to-many avec suppression en cascade), plusieurs Subscription (subscriptions, one-to-many avec suppression en cascade), plusieurs Payment (payments, one-to-many) et plusieurs CompanyActivity (companyActivities, one-to-many avec suppression en cascade). getManager() retourne le premier utilisateur de users portant le rôle ROLE_MANAGER (aucune relation dédiée : simple parcours de la collection). getCurrentSubscription() retourne le premier abonnement de subscriptions dont isActive() est vrai.

Chaque setter (hormis setCreatedAt()) met à jour updatedAt à l'horodatage courant ; ce champ n'est donc jamais synchronisé automatiquement par Doctrine, uniquement par la classe elle-même.

getActivities() / setActivities() sont conservées @deprecated pour compatibilité : getActivities() dérive un tableau de libellés depuis companyActivities, et setActivities() ne fait plus rien d'autre que rafraîchir updatedAt.

Attributes
#[Entity]
#[Table]
$name: 'company'

Table of Contents

Properties

$address  : string|null
$city  : string|null
$companyActivities  : Collection<int, CompanyActivity>
$country  : string|null
$createdAt  : DateTimeImmutable|null
$description  : string|null
$email  : string|null
$employeeCount  : int|null
$employees  : Collection<int, Employee>
$id  : int|null
$isActive  : bool
$logoPath  : string|null
$name  : string|null
$payments  : Collection<int, Payment>
$phone  : string|null
$primaryColor  : string|null
$secondaryColor  : string|null
$subscriptions  : Collection<int, Subscription>
$updatedAt  : DateTimeImmutable|null
$users  : Collection<int, User>
$website  : string|null

Methods

__construct()  : mixed
addCompanyActivity()  : static
addEmployee()  : static
addPayment()  : static
addSubscription()  : static
addUser()  : static
getActivities()  : array<string|int, mixed>|null
Méthode de compatibilité pour l'ancien système
getAddress()  : string|null
getCity()  : string|null
getCompanyActivities()  : Collection<int, CompanyActivity>
getCountry()  : string|null
getCreatedAt()  : DateTimeImmutable|null
getCurrentSubscription()  : Subscription|null
Get the current active subscription
getDescription()  : string|null
getEmail()  : string|null
getEmployeeCount()  : int|null
getEmployees()  : Collection<int, Employee>
getId()  : int|null
getLogoPath()  : string|null
getManager()  : User|null
Get the manager (first user with ROLE_MANAGER) of this company
getName()  : string|null
getPayments()  : Collection<int, Payment>
getPhone()  : string|null
getPrimaryColor()  : string|null
getSecondaryColor()  : string|null
getSubscriptions()  : Collection<int, Subscription>
getUpdatedAt()  : DateTimeImmutable|null
getUsers()  : Collection<int, User>
getWebsite()  : string|null
isActive()  : bool
removeCompanyActivity()  : static
removeEmployee()  : static
removePayment()  : static
removeSubscription()  : static
removeUser()  : static
setActivities()  : static
Méthode de compatibilité pour l'ancien système
setAddress()  : static
setCity()  : static
setCountry()  : static
setCreatedAt()  : static
setDescription()  : static
setEmail()  : static
setEmployeeCount()  : static
setIsActive()  : static
setLogoPath()  : static
setName()  : static
setPhone()  : static
setPrimaryColor()  : static
setSecondaryColor()  : static
setUpdatedAt()  : static
setWebsite()  : static

Properties

$address

private string|null $address = null
Attributes
#[Column]
$length: 255
$nullable: true
#[NotBlank]
$message: 'L\'adresse est obligatoire'

$city

private string|null $city = null
Attributes
#[Column]
$length: 100
$nullable: true
#[NotBlank]
$message: 'La ville est obligatoire'

$companyActivities

private Collection<int, CompanyActivity> $companyActivities
Attributes
#[OneToMany]
$targetEntity: \App\Entity\CompanyActivity::class
$mappedBy: 'company'
$cascade: ['persist', 'remove']

$country

private string|null $country = null
Attributes
#[Column]
$length: 100
$nullable: true
#[NotBlank]
$message: 'Le pays est obligatoire'

$createdAt

private DateTimeImmutable|null $createdAt = null
Attributes
#[Column]

$description

private string|null $description = null
Attributes
#[Column]
$type: 'text'
$nullable: true

$email

private string|null $email = null
Attributes
#[Column]
$length: 255
$nullable: true
#[Email]
$message: 'Veuillez saisir un email valide'

$employeeCount

private int|null $employeeCount = null
Attributes
#[Column]
#[NotBlank]
$message: 'Le nombre d\'employés est obligatoire'
#[Positive]
$message: 'Le nombre d\'employés doit être positif'

$employees

private Collection<int, Employee> $employees
Attributes
#[OneToMany]
$targetEntity: \App\Entity\Employee::class
$mappedBy: 'company'
$cascade: ['persist', 'remove']

$id

private int|null $id = null
Attributes
#[Column]
#[GeneratedValue]
#[Id]

$isActive

private bool $isActive = true
Attributes
#[Column]

$logoPath

private string|null $logoPath = null
Attributes
#[Column]
$length: 255
$nullable: true

$name

private string|null $name = null
Attributes
#[Column]
$length: 255
#[Length]
$min: 2
$max: 255
$minMessage: 'Le nom doit contenir au moins 2 caractères'
#[NotBlank]
$message: 'Le nom de l\'entreprise est obligatoire'

$payments

private Collection<int, Payment> $payments
Attributes
#[OneToMany]
$targetEntity: \App\Entity\Payment::class
$mappedBy: 'company'

$phone

private string|null $phone = null
Attributes
#[Column]
$length: 20
$nullable: true
#[Regex]
$pattern: '/^[+]?[0-9\s\-\(\)]+$/'
$message: 'Numéro de téléphone invalide'

$primaryColor

private string|null $primaryColor = null
Attributes
#[Column]
$length: 7
$nullable: true
#[Regex]
$pattern: '/^#[0-9A-Fa-f]{6}$/'
$message: 'La couleur principale doit être au format hexadécimal (#RRGGBB)'

$secondaryColor

private string|null $secondaryColor = null
Attributes
#[Column]
$length: 7
$nullable: true
#[Regex]
$pattern: '/^#[0-9A-Fa-f]{6}$/'
$message: 'La couleur secondaire doit être au format hexadécimal (#RRGGBB)'

$subscriptions

private Collection<int, Subscription> $subscriptions
Attributes
#[OneToMany]
$targetEntity: \App\Entity\Subscription::class
$mappedBy: 'company'
$cascade: ['persist', 'remove']

$updatedAt

private DateTimeImmutable|null $updatedAt = null
Attributes
#[Column]

$users

private Collection<int, User> $users
Attributes
#[OneToMany]
$targetEntity: \App\Entity\User::class
$mappedBy: 'company'

$website

private string|null $website = null
Attributes
#[Column]
$length: 255
$nullable: true
#[Url]
$message: 'Veuillez entrer une URL valide'

Methods

__construct()

public __construct() : mixed

addEmployee()

public addEmployee(Employee $employee) : static
Parameters
$employee : Employee
Return values
static

addPayment()

public addPayment(Payment $payment) : static
Parameters
$payment : Payment
Return values
static

addUser()

public addUser(User $user) : static
Parameters
$user : User
Return values
static

getActivities()

Méthode de compatibilité pour l'ancien système

public getActivities() : array<string|int, mixed>|null

Utiliser getCompanyActivities() à la place

Return values
array<string|int, mixed>|null

getAddress()

public getAddress() : string|null
Return values
string|null

getCity()

public getCity() : string|null
Return values
string|null

getCountry()

public getCountry() : string|null
Return values
string|null

getCreatedAt()

public getCreatedAt() : DateTimeImmutable|null
Return values
DateTimeImmutable|null

getDescription()

public getDescription() : string|null
Return values
string|null

getEmail()

public getEmail() : string|null
Return values
string|null

getEmployeeCount()

public getEmployeeCount() : int|null
Return values
int|null

getId()

public getId() : int|null
Return values
int|null

getLogoPath()

public getLogoPath() : string|null
Return values
string|null

getManager()

Get the manager (first user with ROLE_MANAGER) of this company

public getManager() : User|null
Return values
User|null

getName()

public getName() : string|null
Return values
string|null

getPhone()

public getPhone() : string|null
Return values
string|null

getPrimaryColor()

public getPrimaryColor() : string|null
Return values
string|null

getSecondaryColor()

public getSecondaryColor() : string|null
Return values
string|null

getUpdatedAt()

public getUpdatedAt() : DateTimeImmutable|null
Return values
DateTimeImmutable|null

getUsers()

public getUsers() : Collection<int, User>
Return values
Collection<int, User>

getWebsite()

public getWebsite() : string|null
Return values
string|null

isActive()

public isActive() : bool
Return values
bool

removeEmployee()

public removeEmployee(Employee $employee) : static
Parameters
$employee : Employee
Return values
static

removePayment()

public removePayment(Payment $payment) : static
Parameters
$payment : Payment
Return values
static

removeUser()

public removeUser(User $user) : static
Parameters
$user : User
Return values
static

setActivities()

Méthode de compatibilité pour l'ancien système

public setActivities(array<string|int, mixed>|null $activities) : static

Utiliser addCompanyActivity() à la place

Parameters
$activities : array<string|int, mixed>|null
Return values
static

setAddress()

public setAddress(string|null $address) : static
Parameters
$address : string|null
Return values
static

setCity()

public setCity(string|null $city) : static
Parameters
$city : string|null
Return values
static

setCountry()

public setCountry(string|null $country) : static
Parameters
$country : string|null
Return values
static

setCreatedAt()

public setCreatedAt(DateTimeImmutable $createdAt) : static
Parameters
$createdAt : DateTimeImmutable
Return values
static

setDescription()

public setDescription(string|null $description) : static
Parameters
$description : string|null
Return values
static

setEmail()

public setEmail(string|null $email) : static
Parameters
$email : string|null
Return values
static

setEmployeeCount()

public setEmployeeCount(int $employeeCount) : static
Parameters
$employeeCount : int
Return values
static

setIsActive()

public setIsActive(bool $isActive) : static
Parameters
$isActive : bool
Return values
static

setLogoPath()

public setLogoPath(string|null $logoPath) : static
Parameters
$logoPath : string|null
Return values
static

setName()

public setName(string $name) : static
Parameters
$name : string
Return values
static

setPhone()

public setPhone(string|null $phone) : static
Parameters
$phone : string|null
Return values
static

setPrimaryColor()

public setPrimaryColor(string|null $primaryColor) : static
Parameters
$primaryColor : string|null
Return values
static

setSecondaryColor()

public setSecondaryColor(string|null $secondaryColor) : static
Parameters
$secondaryColor : string|null
Return values
static

setUpdatedAt()

public setUpdatedAt(DateTimeImmutable $updatedAt) : static
Parameters
$updatedAt : DateTimeImmutable
Return values
static

setWebsite()

public setWebsite(string|null $website) : static
Parameters
$website : string|null
Return values
static

        
On this page

Search results