CoolCMS API

InvoiceTypePdfVariantTreatmentRel extends InvoiceTypePdfVariantTreatmentRel
in package

Matrix of PDF variants by invoice type x VAT treatment code, owned collection `InvoiceType.pdfVariantTreatmentRels` saved by full-replace object-graph save in one save of the invoice type.

Attributes
#[Entity]
#[Table]
$name: 'cms_mod_invoicer_invoice_type_pdf_variant_treatment_rels'
#[TableAlias]
'invoiceTypePdfVariantTreatmentRel'

Table of Contents

Constants

DEFAULT_TREATMENT  : string = '*'
Matrix row for a treatment code that has no row of its own.
TREATMENT_ROWS  : array<string|int, mixed> = [self::DEFAULT_TREATMENT, 'DOMESTIC', 'NON_PAYE...
Matrix rows in admin order: default `*` + codes of {@see \App\UI\Api\System\Models\Enums\TaxTreatmentCode} (values copied here because the Admin/Front layer does not import the Api enum; the unit test `tests/Unit/Invoicer/PdfVariantTreatmentMatrixTest.php` guards the match).

Properties

$invoiceType  : object|null
$invoiceTypeId  : int|null
$pdfTemplateVariantId  : int|null
$taxTreatment  : string|null

Methods

__construct()  : mixed
callInitMethods()  : void
Calls `init{TraitName}()` for every used trait that defines such a method.
getAllTraits()  : array<string, string>
Returns all traits the class uses, including those used by parent classes and nested traits.
getInvoiceType()  : object|null
getInvoiceTypeId()  : int|null
getPdfTemplateVariantId()  : int|null
getTaxTreatment()  : string|null
setInvoiceType()  : static
setInvoiceTypeId()  : static
setPdfTemplateVariantId()  : static
setTaxTreatment()  : static
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Constants

TREATMENT_ROWS

Matrix rows in admin order: default `*` + codes of {@see \App\UI\Api\System\Models\Enums\TaxTreatmentCode} (values copied here because the Admin/Front layer does not import the Api enum; the unit test `tests/Unit/Invoicer/PdfVariantTreatmentMatrixTest.php` guards the match).

public array<string|int, mixed> TREATMENT_ROWS = [self::DEFAULT_TREATMENT, 'DOMESTIC', 'NON_PAYER', 'REVERSE_CHARGE', 'IC_SUPPLY', 'EXPORT', 'OUTSIDE_SCOPE', 'DOMESTIC_REVERSE_CHARGE', 'VOUCHER_ISSUE']

Properties

$invoiceType

protected object|null $invoiceType = null

invoice type (the Api/Admin descendant redeclares the association)

Attributes
#[EntityOf]
\App\UI\Admin\Invoicer\Models\Entities\InvoiceType::class
#[Id]
#[Identity]
#[JoinColumn]
$name: 'cms_mod_invoicer_invoice_types_invoice_type_id'
$referencedColumnName: 'invoice_type_id'
$onDelete: 'CASCADE'
#[ManyToOne]
$targetEntity: \App\UI\Admin\Invoicer\Models\Entities\InvoiceType::class
$inversedBy: 'pdfVariantTreatmentRels'

$invoiceTypeId

protected int|null $invoiceTypeId = null
Attributes
#[Column]
$name: 'cms_mod_invoicer_invoice_types_invoice_type_id'
$type: 'integer'
$insertable: false
$updatable: false
$options: ['unsigned' => true]

$pdfTemplateVariantId

protected int|null $pdfTemplateVariantId = null
Attributes
#[Column]
$name: 'cms_system_pdf_template_variants_pdf_template_variant_id'
$type: 'integer'
$nullable: true
$options: ['unsigned' => true]

Methods

__construct()

public __construct([string|null $taxTreatment = null ][, int|null $invoiceTypeId = null ][, mixed $invoiceType = null ][, int|null $pdfTemplateVariantId = null ]) : mixed
Parameters
$taxTreatment : string|null = null
$invoiceTypeId : int|null = null
$invoiceType : mixed = null
$pdfTemplateVariantId : int|null = null

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>

setPdfTemplateVariantId()

public setPdfTemplateVariantId(int|null $pdfTemplateVariantId) : static
Parameters
$pdfTemplateVariantId : int|null
Return values
static

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