Customer
extends Customer
in package
Customer of an invoice (`cms_mod_invoicer_customers`): `name` plus an owned collection of contacts (multiplier, full-replace object-graph save). Also used in picker mode by the invoice form.
Tags
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_mod_invoicer_customers'
- #[TableAlias]
- 'customer'
Table of Contents
Properties
- $contacts : Collection
- $currencyId : int|null
- $defaultVatPercents : numeric-string|null
- $id : int|null
- $invoicerInvoiceTypeId : int|null
- $languageId : int|null
- $name : string|null
- $paymentRegionId : int|null
- $userId : int|null
Methods
- __construct() : mixed
- addContact() : $this
- callInitMethods() : void
- Calls `init{TraitName}()` for every used trait that defines such a method.
- clearContacts() : $this
- contactCollectionInit() : void
- getAllTraits() : array<string, string>
- Returns all traits the class uses, including those used by parent classes and nested traits.
- getContact() : TContact|null
- getContacts() : Collection<int, TContact>
- getCurrencyId() : int|null
- getDefaultVatPercents() : numeric-string|null
- getId() : int|null
- getInvoicerInvoiceTypeId() : int|null
- getLanguageId() : int|null
- Language of the customer's documents (null falls back to the payment region default, then `7/invoice.default.languageId`).
- getName() : string|null
- getPaymentRegionId() : int|null
- getUserId() : int|null
- isPersisted() : bool
- removeContact() : $this
- setContacts() : $this
- setCurrencyId() : $this
- setDefaultVatPercents() : $this
- setId() : $this
- setInvoicerInvoiceTypeId() : $this
- setLanguageId() : TContact>
- setName() : $this
- setPaymentRegionId() : $this
- setUserId() : TContact>
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$contacts
protected
Collection
$contacts
Attributes
- #[CollectionOf]
- \App\UI\Admin\Invoicer\Models\Entities\CustomerContact::class
- $owned: true
- #[OneToMany]
- $targetEntity: \App\UI\Admin\Invoicer\Models\Entities\CustomerContact::class
- $mappedBy: 'customer'
- $cascade: ["persist", "remove"]
- $orphanRemoval: true
- $fetch: "LAZY"
$currencyId
protected
int|null
$currencyId
= null
Attributes
- #[Column]
- $name: 'cms_system_currencies_currency_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- $nullable: true
$defaultVatPercents
protected
numeric-string|null
$defaultVatPercents
= null
Attributes
- #[Column]
- $name: 'default_vat_percents'
- $type: 'decimal'
- $precision: 5
- $scale: 2
- $nullable: true
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'customer_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$invoicerInvoiceTypeId
protected
int|null
$invoicerInvoiceTypeId
= null
Attributes
- #[Column]
- $name: 'invoicer_invoice_type_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- $nullable: true
$languageId
protected
int|null
$languageId
= null
Attributes
- #[Column]
- $name: 'cms_system_languages_language_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- $nullable: true
$name
protected
string|null
$name
= null
Attributes
- #[Column]
- $name: 'name'
- $type: 'string'
- $length: 255
- $nullable: true
$paymentRegionId
protected
int|null
$paymentRegionId
= null
Attributes
- #[Column]
- $name: 'cms_system_payment_regions_payment_region_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- $nullable: true
$userId
protected
int|null
$userId
= null
Attributes
- #[Column]
- $name: 'cms_system_users_user_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- $nullable: true
Methods
__construct()
public
__construct([int|null $id = null ][, string|null $name = null ][, int|null $userId = null ][, int|null $invoicerInvoiceTypeId = null ][, string|null $defaultVatPercents = null ][, int|null $currencyId = null ][, int|null $paymentRegionId = null ][, int|null $languageId = null ][, Collection $contacts = new ArrayCollection() ]) : mixed
Parameters
- $id : int|null = null
- $name : string|null = null
- $userId : int|null = null
- $invoicerInvoiceTypeId : int|null = null
- $defaultVatPercents : string|null = null
- $currencyId : int|null = null
- $paymentRegionId : int|null = null
- $languageId : int|null = null
- $contacts : Collection = new ArrayCollection()
addContact()
public
addContact(TContact $contact) : $this
Parameters
- $contact : TContact
Return values
$thiscallInitMethods()
Calls `init{TraitName}()` for every used trait that defines such a method.
public
callInitMethods() : void
clearContacts()
public
clearContacts() : $this
Return values
$thiscontactCollectionInit()
public
contactCollectionInit() : void
getAllTraits()
Returns all traits the class uses, including those used by parent classes and nested traits.
public
getAllTraits() : array<string, string>
Return values
array<string, string>getContact()
public
getContact(int $contactId) : TContact|null
Parameters
- $contactId : int
Return values
TContact|nullgetContacts()
public
getContacts() : Collection<int, TContact>
Return values
Collection<int, TContact>getCurrencyId()
public
getCurrencyId() : int|null
Return values
int|nullgetDefaultVatPercents()
public
getDefaultVatPercents() : numeric-string|null
Return values
numeric-string|nullgetId()
public
getId() : int|null
Return values
int|nullgetInvoicerInvoiceTypeId()
public
getInvoicerInvoiceTypeId() : int|null
Return values
int|nullgetLanguageId()
Language of the customer's documents (null falls back to the payment region default, then `7/invoice.default.languageId`).
public
getLanguageId() : int|null
Return values
int|nullgetName()
public
getName() : string|null
Return values
string|nullgetPaymentRegionId()
public
getPaymentRegionId() : int|null
Return values
int|nullgetUserId()
public
getUserId() : int|null
Return values
int|nullisPersisted()
public
isPersisted() : bool
Return values
boolremoveContact()
public
removeContact(TContact $contact) : $this
Parameters
- $contact : TContact
Return values
$thissetContacts()
public
setContacts(Collection<int, TContact>|array<int, TContact> $contacts) : $this
Parameters
- $contacts : Collection<int, TContact>|array<int, TContact>
Return values
$thissetCurrencyId()
public
setCurrencyId(int|null $currencyId) : $this
Parameters
- $currencyId : int|null
Return values
$thissetDefaultVatPercents()
public
setDefaultVatPercents(int|float|string|null $defaultVatPercents) : $this
Parameters
- $defaultVatPercents : int|float|string|null
Return values
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetInvoicerInvoiceTypeId()
public
setInvoicerInvoiceTypeId(int|null $invoicerInvoiceTypeId) : $this
Parameters
- $invoicerInvoiceTypeId : int|null
Return values
$thissetLanguageId()
public
setLanguageId(int|null $languageId) : TContact>
Parameters
- $languageId : int|null
Return values
TContact>setName()
public
setName(string|null $name) : $this
Parameters
- $name : string|null
Return values
$thissetPaymentRegionId()
public
setPaymentRegionId(int|null $paymentRegionId) : $this
Parameters
- $paymentRegionId : int|null
Return values
$thissetUserId()
public
setUserId(int|null $userId) : TContact>
Parameters
- $userId : int|null
Return values
TContact>getTraitsRecursive()
Walks the trait list recursively and collects nested traits too.
private
static getTraitsRecursive(array<string, string> $traits) : array<string, string>
Parameters
- $traits : array<string, string>