CoolCMS API

UserTypeFormTrait

Add/edit form of a user type.

The skeleton comes from BasePresenter::createForm(), multilingual fields and conversions from AdminFormHelpersTrait.

Translated attribute: name. Untranslated flags: requiresCompanyData, requiresVatId.

NOTE: the VAT payer status per payment region is not edited here: the seller status lives in the history cms_mod_invoicer_seller_tax_statuses, not in a UserType x PaymentRegion matrix.

Table of Contents

Methods

createComponentEditForm()  : Form
addSettingsFields()  : void
User type flags: requires company data / VAT ID.
addTranslationFields()  : void
Multilingual fields: name per language (`name_<langId>`), active per checkbox.
buildUserTypeEntity()  : UserType
saveUserTypeForm()  : bool
Saves the form data. The redirect is handled by {@see \App\Core\Base\Admin\BasePresenter::createForm()}.
setUserTypeFormDefaults()  : void

Methods

addSettingsFields()

User type flags: requires company data / VAT ID.

private addSettingsFields(Form $form) : void
Parameters
$form : Form

addTranslationFields()

Multilingual fields: name per language (`name_<langId>`), active per checkbox.

private addTranslationFields(Form $form) : void
Parameters
$form : Form

buildUserTypeEntity()

private buildUserTypeEntity(ArrayHash<string|int, mixed> $values) : UserType
Parameters
$values : ArrayHash<string|int, mixed>
Return values
UserType

saveUserTypeForm()

Saves the form data. The redirect is handled by {@see \App\Core\Base\Admin\BasePresenter::createForm()}.

private saveUserTypeForm(ArrayHash<string|int, mixed> $values) : bool
Parameters
$values : ArrayHash<string|int, mixed>
Return values
bool
On this page

Search results