Drupal 8  8.0.2
MessageForm Class Reference
Inheritance diagram for MessageForm:

Public Member Functions

 __construct (EntityManagerInterface $entity_manager, FloodInterface $flood, LanguageManagerInterface $language_manager, MailHandlerInterface $mail_handler, DateFormatterInterface $date_formatter)
 
 form (array $form, FormStateInterface $form_state)
 
 actions (array $form, FormStateInterface $form_state)
 
 preview (array $form, FormStateInterface $form_state)
 
 validateForm (array &$form, FormStateInterface $form_state)
 
 save (array $form, FormStateInterface $form_state)
 
- Public Member Functions inherited from ContentEntityForm
 __construct (EntityManagerInterface $entity_manager)
 
 form (array $form, FormStateInterface $form_state)
 
 submitForm (array &$form, FormStateInterface $form_state)
 
 getFormLangcode (FormStateInterface $form_state)
 
 isDefaultFormLangcode (FormStateInterface $form_state)
 
 getFormDisplay (FormStateInterface $form_state)
 
 setFormDisplay (EntityFormDisplayInterface $form_display, FormStateInterface $form_state)
 
 updateFormLangcode ($entity_type_id, EntityInterface $entity, array $form, FormStateInterface $form_state)
 
 updateChangedTime (EntityInterface $entity)
 
- Public Member Functions inherited from EntityForm
 setOperation ($operation)
 
 getBaseFormId ()
 
 getFormId ()
 
 buildForm (array $form, FormStateInterface $form_state)
 
 form (array $form, FormStateInterface $form_state)
 
 processForm ($element, FormStateInterface $form_state, $form)
 
 afterBuild (array $element, FormStateInterface $form_state)
 
 submitForm (array &$form, FormStateInterface $form_state)
 
 save (array $form, FormStateInterface $form_state)
 
 buildEntity (array $form, FormStateInterface $form_state)
 
 getEntity ()
 
 setEntity (EntityInterface $entity)
 
 getEntityFromRouteMatch (RouteMatchInterface $route_match, $entity_type_id)
 
 getOperation ()
 
 setModuleHandler (ModuleHandlerInterface $module_handler)
 
 setEntityManager (EntityManagerInterface $entity_manager)
 
 setEntityTypeManager (EntityTypeManagerInterface $entity_type_manager)
 
- Public Member Functions inherited from EntityFormInterface
 setStringTranslation (TranslationInterface $string_translation)
 

Static Public Member Functions

static create (ContainerInterface $container)
 
- Static Public Member Functions inherited from ContentEntityForm
static create (ContainerInterface $container)
 

Protected Attributes

 $entity
 
 $flood
 
 $languageManager
 
 $mailHandler
 
 $dateFormatter
 
- Protected Attributes inherited from ContentEntityForm
 $entityManager
 
- Protected Attributes inherited from EntityForm
 $operation
 
 $moduleHandler
 
 $entityManager
 
 $entityTypeManager
 
 $entity
 

Additional Inherited Members

- Protected Member Functions inherited from ContentEntityForm
 getEditedFieldNames (FormStateInterface $form_state)
 
 init (FormStateInterface $form_state)
 
 initFormLangcodes (FormStateInterface $form_state)
 
 copyFormValuesToEntity (EntityInterface $entity, array $form, FormStateInterface $form_state)
 
- Protected Member Functions inherited from EntityForm
 init (FormStateInterface $form_state)
 
 actionsElement (array $form, FormStateInterface $form_state)
 
 actions (array $form, FormStateInterface $form_state)
 
 copyFormValuesToEntity (EntityInterface $entity, array $form, FormStateInterface $form_state)
 
 prepareEntity ()
 
 prepareInvokeAll ($hook, FormStateInterface $form_state)
 

Detailed Description

Form controller for contact message forms.

Constructor & Destructor Documentation

__construct ( EntityManagerInterface  $entity_manager,
FloodInterface  $flood,
LanguageManagerInterface  $language_manager,
MailHandlerInterface  $mail_handler,
DateFormatterInterface  $date_formatter 
)

Constructs a MessageForm object.

Parameters
\Drupal\Core\Entity\EntityManagerInterface$entity_managerThe entity manager.
\Drupal\Core\Flood\FloodInterface$floodThe flood control mechanism.
\Drupal\Core\Language\LanguageManagerInterface$language_managerThe language manager service.
\Drupal\contact\MailHandlerInterface$mail_handlerThe contact mail handler service.
\Drupal\Core\Datetime\DateFormatterInterface$date_formatterThe date service.

References Drupal\flood(), and Drupal\languageManager().

Here is the call graph for this function:

Member Function Documentation

actions ( array  $form,
FormStateInterface  $form_state 
)

{}

References t().

Here is the call graph for this function:

static create ( ContainerInterface  $container)
static

{}

form ( array  $form,
FormStateInterface  $form_state 
)

{}

References Drupal\currentUser(), Drupal\entityManager(), and t().

Here is the call graph for this function:

preview ( array  $form,
FormStateInterface  $form_state 
)

Form submission handler for the 'preview' action.

References FormStateInterface\setRebuild().

Here is the call graph for this function:

save ( array  $form,
FormStateInterface  $form_state 
)

{Form submission handler for the 'save' action.Normally this method should be overridden to provide specific messages to the user and redirect the form after the entity has been saved.

Parameters
array$formAn associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the form.
Returns
int Either SAVED_NEW or SAVED_UPDATED, depending on the operation performed.
}

Implements EntityFormInterface.

References Drupal\config(), Drupal\currentUser(), Drupal\flood(), FormStateInterface\setRedirect(), FormStateInterface\setRedirectUrl(), and t().

Here is the call graph for this function:

validateForm ( array &  $form,
FormStateInterface  $form_state 
)

{{Form validation handler.

Parameters
array$formAn associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface$form_stateThe current state of the form.
}Note that extending classes should not override this method to add entity validation logic, but define further validation constraints using the entity validation API and/or provide a new validation constraint if necessary. This is the only way to ensure that the validation logic is correctly applied independently of form submissions; e.g., for REST requests. For more information about entity validation, see https://www.drupal.org/node/2015613.
Returns
The built entity.
}

Implements ContentEntityFormInterface.

References Drupal\config(), Drupal\currentUser(), Drupal\flood(), FormStateInterface\setErrorByName(), and t().

Here is the call graph for this function:


The documentation for this class was generated from the following file: