CoolCMS API

AdvertFormFieldsTrait

Admin-only advert 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 (the Api computes it from parameters), active (read-only) or rating_thread_id. The e-mail is not an admin field but a dynamic parameter.

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 advert 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

addOwnerFields()

Adds the hidden field for the advert 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|null

advLabel()

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
string

advStr()

private advStr(mixed $value) : string
Parameters
$value : mixed
Return values
string

advStrOrNull()

private advStrOrNull(mixed $value) : string|null
Parameters
$value : mixed
Return values
string|null
On this page

Search results