CoolCMS API

InvoiceType extends InvoiceType
in package

Tags
extends
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()

addTranslation()

public addTranslation(TTranslation $translation) : $this
Parameters
$translation : TTranslation
Return values
$this

callInitMethods()

Calls `init{TraitName}()` for every used trait that defines such a method.

public callInitMethods() : 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>

getBillingLineId()

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

getCreditNote()

public getCreditNote() : bool
Return values
bool

getKey()

public getKey() : string
Return values
string

getMultipleUse()

public getMultipleUse() : bool
Return values
bool

getPdfTemplateVariantRel()

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|null

getRequiresInvoice()

public getRequiresInvoice() : bool
Return values
bool

getTranslation()

public getTranslation(int $langId) : TTranslation|null
Parameters
$langId : int
Return values
TTranslation|null

getTranslations()

public getTranslations() : Collection<int, TTranslation>
Return values
Collection<int, TTranslation>

isCreditNote()

public isCreditNote() : bool
Return values
bool

isMultipleUse()

public isMultipleUse() : bool
Return values
bool

removePdfTemplateVariantRel()

public removePdfTemplateVariantRel(TPdfTemplateVariantRel $pdfTemplateVariantRel) : $this
Parameters
$pdfTemplateVariantRel : TPdfTemplateVariantRel
Return values
$this

removeTranslation()

public removeTranslation(TTranslation $translation) : $this
Parameters
$translation : TTranslation
Return values
$this

requiresInvoice()

public requiresInvoice() : bool
Return values
bool

resolvePdfVariantIdForTreatment()

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|null

setBillingLineId()

public setBillingLineId(int|null $billingLineId) : $this
Parameters
$billingLineId : int|null
Return values
$this

setCreditNote()

public setCreditNote(bool $creditNote) : $this
Parameters
$creditNote : bool
Return values
$this

setId()

public setId(int|null $id) : $this
Parameters
$id : int|null
Return values
$this

setKey()

public setKey(string $key) : $this
Parameters
$key : string
Return values
$this

setMultipleUse()

public setMultipleUse(bool $multipleUse) : $this
Parameters
$multipleUse : bool
Return values
$this

setPdfTemplateVariantRels()

public setPdfTemplateVariantRels(Collection<int, TPdfTemplateVariantRel>|array<string|int, TPdfTemplateVariantRel> $pdfTemplateVariantRels) : $this
Parameters
$pdfTemplateVariantRels : Collection<int, TPdfTemplateVariantRel>|array<string|int, TPdfTemplateVariantRel>
Return values
$this

setPdfVariantTreatmentRels()

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
static

setRequiresInvoice()

public setRequiresInvoice(bool $requiresInvoice) : $this
Parameters
$requiresInvoice : bool
Return values
$this

setTranslations()

public setTranslations(Collection<int, TTranslation>|array<int, TTranslation> $translations) : $this
Parameters
$translations : Collection<int, TTranslation>|array<int, TTranslation>
Return values
$this

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>
Return values
array<string, string>
On this page

Search results