FormTrait
Table of Contents
Constants
- TEXT_MAX_LENGTH : int = 10000
- Upper limit of the visible post text (the same cap as the contact message).
Methods
- onError() : void
- onSuccess() : void
- createComponentForm() : Form
- addCategoryField() : void
- addImageFields() : void
- pendingPublicationNoticeKey() : string|null
- Returns the translation key of the message about the next step after insert ({@see PendingPublicationNotice}), or null when the post is both confirmed and approved (plain "saved" is enough).
- prepareCategoryOptions() : array<int, string>
- setDefaults() : void
Constants
TEXT_MAX_LENGTH
Upper limit of the visible post text (the same cap as the contact message).
private
int
TEXT_MAX_LENGTH
= 10000
Methods
onError()
public
onError() : void
onSuccess()
public
onSuccess(Form $form, ArrayHash $values) : void
Parameters
- $form : Form
- $values : ArrayHash
createComponentForm()
protected
createComponentForm() : Form
Return values
FormaddCategoryField()
private
addCategoryField(Form $form, callable $t) : void
Parameters
- $form : Form
- $t : callable
addImageFields()
private
addImageFields(Form $form) : void
Parameters
- $form : Form
pendingPublicationNoticeKey()
Returns the translation key of the message about the next step after insert ({@see PendingPublicationNotice}), or null when the post is both confirmed and approved (plain "saved" is enough).
private
pendingPublicationNoticeKey(Message|null $saved) : string|null
The state is the post read fresh from the Api after insert; the $message from the form carries
neither confirmation nor approval, because the Api sets them on insert.
Parameters
- $saved : Message|null
Return values
string|nullprepareCategoryOptions()
private
prepareCategoryOptions() : array<int, string>
Return values
array<int, string> —category id => name indented by level
setDefaults()
private
setDefaults(Form $form) : void
Parameters
- $form : Form