ProductSetLinkFormTrait
Edit/add form of a link: a multilingual pair `name` (optional label, nullable) + `value` (required URL/value) and an untranslated link type (select; a small flat code list {@see ProductSetLinkType} needs only a plain Nette select, not a picker, like `Admin\Invoicer\SettingPresenter::billingLineOptions()` / {@see ProductSetFeeFormTrait::addProductSetFeeTypeField()}).
The skeleton (check, domain translator, save/update/cancel buttons and return) comes from BasePresenter::createForm().
Table of Contents
Methods
- createComponentEditForm() : Form
- addProductSetLinkTranslationFields() : void
- Multilingual fields: one set per language (`active_<langId>`/`name_<langId>`/`value_<langId>`), active per checkbox. `name` is an optional label (may stay empty); `value` (the actual URL/value) is required for an active translation.
- addProductSetLinkTypeField() : void
- buildProductSetLinkEntity() : ProductSetLink
- linkTypeOptions() : array<int, NotTranslate>
- Options of the link type select: a small flat code list {@see ProductSetLinkType}, read directly (no cache, like {@see \App\UI\Admin\Invoicer\Presenters\Traits\InvoicerSelectDataTrait::billingLineOptions()}).
- saveProductSetLinkForm() : bool
- setProductSetLinkFormDefaults() : void
Methods
createComponentEditForm()
protected
createComponentEditForm() : Form
Return values
FormaddProductSetLinkTranslationFields()
Multilingual fields: one set per language (`active_<langId>`/`name_<langId>`/`value_<langId>`), active per checkbox. `name` is an optional label (may stay empty); `value` (the actual URL/value) is required for an active translation.
private
addProductSetLinkTranslationFields(Form $form) : void
Parameters
- $form : Form
addProductSetLinkTypeField()
private
addProductSetLinkTypeField(Form $form) : void
Parameters
- $form : Form
buildProductSetLinkEntity()
private
buildProductSetLinkEntity(ArrayHash<string|int, mixed> $values) : ProductSetLink
Parameters
- $values : ArrayHash<string|int, mixed>
Return values
ProductSetLinklinkTypeOptions()
Options of the link type select: a small flat code list {@see ProductSetLinkType}, read directly (no cache, like {@see \App\UI\Admin\Invoicer\Presenters\Traits\InvoicerSelectDataTrait::billingLineOptions()}).
private
linkTypeOptions() : array<int, NotTranslate>
The name is ready data, not a key, hence NotTranslate.
Return values
array<int, NotTranslate>saveProductSetLinkForm()
private
saveProductSetLinkForm(ArrayHash<string|int, mixed> $values) : bool
Parameters
- $values : ArrayHash<string|int, mixed>
Return values
boolsetProductSetLinkFormDefaults()
private
setProductSetLinkFormDefaults(Form $form) : void
Parameters
- $form : Form