CoolCMS API

PdfVariantMatrixTrait

Axes of the PDF variant matrix shared by both views of the same relation table `cms_mod_invoicer_invoice_type_pdf_template_variant_relations`.

The views: InvoiceTypePresenter (3rd axis PaymentRegion, fixed entity InvoiceType) and PaymentRegionPresenter (3rd axis InvoiceType, fixed entity PaymentRegion). The trait does not inject the managers (productTypeManager/userTypeManager/pdfTemplateManager); the presenter carries them (constructor or #[Inject]), so the trait does not collide when used in two modules.

Table of Contents

Properties

$matrixPdfVariantOptions  : array<int, string>
$matrixProductTypes  : array<int, ProductType>
$matrixUserTypes  : array<int, UserType>

Methods

loadPdfVariantMatrixAxes()  : void
Common matrix axes (product type, user type) and PDF variant options.
loadPdfVariantOptions()  : array<int, string>
Returns flat PDF variant options across all templates, labeled "template: variant" (a variant is an owned collection of `PdfTemplate`, there is no top-level manager).
pdfVariantSellerModes()  : array<int, string>
Returns the matrix halves by seller mode (column `seller_use_vat`): 1 = VAT payer, 0 = non-payer. Key = column value, value = tab translation key.

Properties

$matrixPdfVariantOptions

private array<int, string> $matrixPdfVariantOptions = []

pdfTemplateVariantId => "template: variant"

Methods

loadPdfVariantMatrixAxes()

Common matrix axes (product type, user type) and PDF variant options.

private loadPdfVariantMatrixAxes() : void

loadPdfVariantOptions()

Returns flat PDF variant options across all templates, labeled "template: variant" (a variant is an owned collection of `PdfTemplate`, there is no top-level manager).

private loadPdfVariantOptions() : array<int, string>
Return values
array<int, string>

pdfVariantSellerModes()

Returns the matrix halves by seller mode (column `seller_use_vat`): 1 = VAT payer, 0 = non-payer. Key = column value, value = tab translation key.

private pdfVariantSellerModes() : array<int, string>

IMPORTANT: the matrix is dense, so both halves must always be rendered and saved. Nette evaluates an unrendered field as empty on submit and the full replace of the collection would delete that half of the matrix.

Return values
array<int, string>
On this page

Search results