AdvertFormFieldsTrait
Admin-only company profile fields (outside the dynamic parameters handled by {@see \App\Core\Form\Parameters\ParameterFieldBuilder}).
Called from AdvertFormTrait::createComponentEditForm(). Maps all editable entity fields that the front end handles through parameters or the user does not edit: counters, moderation, times, topping, language and localization, notification flags.
Does not edit price, active (read-only) or rating_thread_id. The e-mail is not an admin
field but a dynamic parameter. The author (user) and region are separate pickers.
NOTE: insert_datetime and insert_ip are read-only (disabled).
Table of Contents
Constants
- ADV_DT_FORMAT : mixed = 'Y-m-d\TH:i'
- Value format of `<input type=datetime-local>`.
Methods
- addAdminFields() : void
- addOwnerFields() : void
- Adds the hidden field for the profile author (user), filled by the picker (suggest or modal) with `insert_user_id`. {@see AdvertBuildTrait::buildAdvert()} sets it as a managed association.
- advIntOrNull() : int|null
- advLabel() : string
- Translates a relative key through the presenter translator and domain, for labels rendered raw (group legends) where Nette `{label}` does not help.
- advStr() : string
- advStrOrNull() : string|null
Constants
ADV_DT_FORMAT
Value format of `<input type=datetime-local>`.
private
mixed
ADV_DT_FORMAT
= 'Y-m-d\TH:i'
Methods
addAdminFields()
private
addAdminFields(Form $form) : void
Parameters
- $form : Form
addOwnerFields()
Adds the hidden field for the profile author (user), filled by the picker (suggest or modal) with `insert_user_id`. {@see AdvertBuildTrait::buildAdvert()} sets it as a managed association.
private
addOwnerFields(Form $form) : void
The region is not an admin field but the parameter SELECT_REGION rendered as a picker; see
AdvertCategoryFieldsTrait::pickers() and the denormalization in buildAdvert().
Parameters
- $form : Form
advIntOrNull()
private
advIntOrNull(mixed $value) : int|null
Parameters
- $value : mixed
Return values
int|nulladvLabel()
Translates a relative key through the presenter translator and domain, for labels rendered raw (group legends) where Nette `{label}` does not help.
private
advLabel(string $key) : string
Parameters
- $key : string
Return values
stringadvStr()
private
advStr(mixed $value) : string
Parameters
- $value : mixed
Return values
stringadvStrOrNull()
private
advStrOrNull(mixed $value) : string|null
Parameters
- $value : mixed