InvoiceType
extends InvoiceType
in package
Tags
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_mod_invoicer_invoice_types'
- #[TableAlias]
- 'invoiceType'
Table of Contents
Properties
- $billingLineId : int|null
- $creditNote : bool
- $id : int|null
- $key : string
- $multipleUse : bool
- $pdfTemplateVariantRels : Collection<int, InvoiceTypePdfTemplateVariantRel>
- Matrix of PDF variants (ProductType x PaymentRegion x UserType -> PdfTemplateVariant), owned collection saved by full-replace object-graph save.
- $pdfVariantTreatmentRels : Collection<int, InvoiceTypePdfVariantTreatmentRel>
- Matrix of PDF variants by invoice type x VAT treatment code, owned collection saved by full-replace object-graph save in one save of the invoice type (one Api transaction).
- $requiresInvoice : bool
- $translations : Collection
Methods
- __construct() : mixed
- addPdfTemplateVariantRel() : $this
- addTranslation() : $this
- callInitMethods() : void
- Calls `init{TraitName}()` for every used trait that defines such a method.
- clearPdfTemplateVariantRels() : $this
- getAllTraits() : array<string, string>
- Returns all traits the class uses, including those used by parent classes and nested traits.
- getBillingLineId() : int|null
- getCreditNote() : bool
- getId() : int|null
- getKey() : string
- getMultipleUse() : bool
- getPdfTemplateVariantRel() : TPdfTemplateVariantRel|null
- getPdfTemplateVariantRels() : Collection<int, TPdfTemplateVariantRel>
- getPdfVariantTreatmentRel() : InvoiceTypePdfVariantTreatmentRel|null
- Returns the matrix row for exactly the given code (including `*`), without fallback.
- getPdfVariantTreatmentRels() : Collection<int, InvoiceTypePdfVariantTreatmentRel>
- getRequiresInvoice() : bool
- getTranslation() : TTranslation|null
- getTranslations() : Collection<int, TTranslation>
- invoiceTypePdfTemplateVariantRelCollectionInit() : void
- invoiceTypePdfVariantTreatmentRelCollectionInit() : void
- isCreditNote() : bool
- isMultipleUse() : bool
- isPersisted() : bool
- removePdfTemplateVariantRel() : $this
- removeTranslation() : $this
- requiresInvoice() : bool
- resolvePdfVariantIdForTreatment() : int|null
- Returns the PDF variant id for a treatment code: the exact-match row with a variant, else the default row `*`.
- setBillingLineId() : $this
- setCreditNote() : $this
- setId() : $this
- setKey() : $this
- setMultipleUse() : $this
- setPdfTemplateVariantRels() : $this
- setPdfVariantTreatmentRels() : static
- The setter accepts `Collection`, not only `ArrayCollection`; the keep branch of the Api `SaveTrait` copies a managed `PersistentCollection`.
- setRequiresInvoice() : $this
- setTranslations() : $this
- translationCollectionInit() : void
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$billingLineId
protected
int|null
$billingLineId
= null
Attributes
- #[Column]
- $name: 'cms_mod_invoicer_billing_lines_billing_line_id'
- $type: 'integer'
- $nullable: true
- $options: ['unsigned' => true]
$creditNote
protected
bool
$creditNote
= false
Attributes
- #[Column]
- $name: 'credit_note'
- $type: 'boolean'
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'invoice_type_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$key
protected
string
$key
= ''
Attributes
- #[Column]
- $name: '`key`'
- $type: 'string'
- $length: 255
$multipleUse
protected
bool
$multipleUse
= false
Attributes
- #[Column]
- $name: 'multiple_use'
- $type: 'boolean'
$pdfTemplateVariantRels
Matrix of PDF variants (ProductType x PaymentRegion x UserType -> PdfTemplateVariant), owned collection saved by full-replace object-graph save.
protected
Collection<int, InvoiceTypePdfTemplateVariantRel>
$pdfTemplateVariantRels
Attributes
- #[CollectionOf]
- \App\UI\Admin\Invoicer\Models\Entities\InvoiceTypePdfTemplateVariantRel::class
- $owned: true
- #[OneToMany]
- $targetEntity: \App\UI\Admin\Invoicer\Models\Entities\InvoiceTypePdfTemplateVariantRel::class
- $mappedBy: 'invoiceType'
- $cascade: ["persist", "remove"]
- $orphanRemoval: true
- $fetch: "LAZY"
$pdfVariantTreatmentRels
Matrix of PDF variants by invoice type x VAT treatment code, owned collection saved by full-replace object-graph save in one save of the invoice type (one Api transaction).
protected
Collection<int, InvoiceTypePdfVariantTreatmentRel>
$pdfVariantTreatmentRels
Attributes
- #[CollectionOf]
- \App\UI\Admin\Invoicer\Models\Entities\InvoiceTypePdfVariantTreatmentRel::class
- $owned: true
- #[OneToMany]
- $targetEntity: \App\UI\Admin\Invoicer\Models\Entities\InvoiceTypePdfVariantTreatmentRel::class
- $mappedBy: 'invoiceType'
- $cascade: ["persist", "remove"]
- $orphanRemoval: true
- $fetch: "LAZY"
$requiresInvoice
protected
bool
$requiresInvoice
= false
Attributes
- #[Column]
- $name: 'requires_invoice'
- $type: 'boolean'
$translations
protected
Collection
$translations
Attributes
- #[CollectionOf]
- \App\UI\Admin\Invoicer\Models\Entities\InvoiceTypeText::class
- $owned: true
- #[OneToMany]
- $targetEntity: \App\UI\Admin\Invoicer\Models\Entities\InvoiceTypeText::class
- $mappedBy: 'invoiceType'
- $cascade: ["persist", "remove"]
- $orphanRemoval: true
- $fetch: "LAZY"
Methods
__construct()
public
__construct([int|null $id = null ][, bool $multipleUse = false ][, string $key = '' ][, Collection $translations = new ArrayCollection() ][, Collection $pdfTemplateVariantRels = new ArrayCollection() ][, bool $creditNote = false ][, int|null $billingLineId = null ][, bool $requiresInvoice = false ][, Collection $pdfVariantTreatmentRels = new ArrayCollection() ]) : mixed
Parameters
- $id : int|null = null
- $multipleUse : bool = false
- $key : string = ''
- $translations : Collection = new ArrayCollection()
- $pdfTemplateVariantRels : Collection = new ArrayCollection()
- $creditNote : bool = false
- $billingLineId : int|null = null
- $requiresInvoice : bool = false
- $pdfVariantTreatmentRels : Collection = new ArrayCollection()
addPdfTemplateVariantRel()
public
addPdfTemplateVariantRel(TPdfTemplateVariantRel $pdfTemplateVariantRel) : $this
Parameters
- $pdfTemplateVariantRel : TPdfTemplateVariantRel
Return values
$thisaddTranslation()
public
addTranslation(TTranslation $translation) : $this
Parameters
- $translation : TTranslation
Return values
$thiscallInitMethods()
Calls `init{TraitName}()` for every used trait that defines such a method.
public
callInitMethods() : void
clearPdfTemplateVariantRels()
public
clearPdfTemplateVariantRels() : $this
Return values
$thisgetAllTraits()
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>getBillingLineId()
public
getBillingLineId() : int|null
Return values
int|nullgetCreditNote()
public
getCreditNote() : bool
Return values
boolgetId()
public
getId() : int|null
Return values
int|nullgetKey()
public
getKey() : string
Return values
stringgetMultipleUse()
public
getMultipleUse() : bool
Return values
boolgetPdfTemplateVariantRel()
public
getPdfTemplateVariantRel([int|null $productTypeId = null ][, int|null $paymentRegionId = null ][, int|null $buyerVatType = null ][, int|null $sellerUseVat = null ]) : TPdfTemplateVariantRel|null
Parameters
- $productTypeId : int|null = null
- $paymentRegionId : int|null = null
- $buyerVatType : int|null = null
- $sellerUseVat : int|null = null
Return values
TPdfTemplateVariantRel|nullgetPdfTemplateVariantRels()
public
getPdfTemplateVariantRels() : Collection<int, TPdfTemplateVariantRel>
Return values
Collection<int, TPdfTemplateVariantRel>getPdfVariantTreatmentRel()
Returns the matrix row for exactly the given code (including `*`), without fallback.
public
getPdfVariantTreatmentRel(string $taxTreatment) : InvoiceTypePdfVariantTreatmentRel|null
Parameters
- $taxTreatment : string
Return values
InvoiceTypePdfVariantTreatmentRel|nullgetPdfVariantTreatmentRels()
public
getPdfVariantTreatmentRels() : Collection<int, InvoiceTypePdfVariantTreatmentRel>
Return values
Collection<int, InvoiceTypePdfVariantTreatmentRel>getRequiresInvoice()
public
getRequiresInvoice() : bool
Return values
boolgetTranslation()
public
getTranslation(int $langId) : TTranslation|null
Parameters
- $langId : int
Return values
TTranslation|nullgetTranslations()
public
getTranslations() : Collection<int, TTranslation>
Return values
Collection<int, TTranslation>invoiceTypePdfTemplateVariantRelCollectionInit()
public
invoiceTypePdfTemplateVariantRelCollectionInit() : void
invoiceTypePdfVariantTreatmentRelCollectionInit()
public
invoiceTypePdfVariantTreatmentRelCollectionInit() : void
isCreditNote()
public
isCreditNote() : bool
Return values
boolisMultipleUse()
public
isMultipleUse() : bool
Return values
boolisPersisted()
public
isPersisted() : bool
Return values
boolremovePdfTemplateVariantRel()
public
removePdfTemplateVariantRel(TPdfTemplateVariantRel $pdfTemplateVariantRel) : $this
Parameters
- $pdfTemplateVariantRel : TPdfTemplateVariantRel
Return values
$thisremoveTranslation()
public
removeTranslation(TTranslation $translation) : $this
Parameters
- $translation : TTranslation
Return values
$thisrequiresInvoice()
public
requiresInvoice() : bool
Return values
boolresolvePdfVariantIdForTreatment()
Returns the PDF variant id for a treatment code: the exact-match row with a variant, else the default row `*`.
public
resolvePdfVariantIdForTreatment(string $taxTreatment) : int|null
A code row without a variant (null) means "follow *". A null result means even the default row has
no variant, so the caller logs it and no PDF is produced.
Parameters
- $taxTreatment : string
Return values
int|nullsetBillingLineId()
public
setBillingLineId(int|null $billingLineId) : $this
Parameters
- $billingLineId : int|null
Return values
$thissetCreditNote()
public
setCreditNote(bool $creditNote) : $this
Parameters
- $creditNote : bool
Return values
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetKey()
public
setKey(string $key) : $this
Parameters
- $key : string
Return values
$thissetMultipleUse()
public
setMultipleUse(bool $multipleUse) : $this
Parameters
- $multipleUse : bool
Return values
$thissetPdfTemplateVariantRels()
public
setPdfTemplateVariantRels(Collection<int, TPdfTemplateVariantRel>|array<string|int, TPdfTemplateVariantRel> $pdfTemplateVariantRels) : $this
Parameters
- $pdfTemplateVariantRels : Collection<int, TPdfTemplateVariantRel>|array<string|int, TPdfTemplateVariantRel>
Return values
$thissetPdfVariantTreatmentRels()
The setter accepts `Collection`, not only `ArrayCollection`; the keep branch of the Api `SaveTrait` copies a managed `PersistentCollection`.
public
setPdfVariantTreatmentRels(Collection<int, InvoiceTypePdfVariantTreatmentRel>|array<string|int, InvoiceTypePdfVariantTreatmentRel> $rels) : static
Parameters
- $rels : Collection<int, InvoiceTypePdfVariantTreatmentRel>|array<string|int, InvoiceTypePdfVariantTreatmentRel>
Return values
staticsetRequiresInvoice()
public
setRequiresInvoice(bool $requiresInvoice) : $this
Parameters
- $requiresInvoice : bool
Return values
$thissetTranslations()
public
setTranslations(Collection<int, TTranslation>|array<int, TTranslation> $translations) : $this
Parameters
- $translations : Collection<int, TTranslation>|array<int, TTranslation>
Return values
$thistranslationCollectionInit()
public
translationCollectionInit() : void
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>