function entity_form_submit

Retrieves, populates, and processes an entity form.

Parameters

EntityInterface $entity: The entity to be created or edited.

$operation: (optional) The operation identifying the form to be submitted.

$form_state: (optional) A keyed array containing the current state of the form.

Return value

A $form_state array already filled with the entity form controller.

File

drupal/core/includes/entity.inc, line 465
Entity API for handling entities like nodes or users.

Code

function entity_form_submit(EntityInterface $entity, $operation = 'default', &$form_state = array()) {
  $form_state += entity_form_state_defaults($entity, $operation);
  $form_id = $form_state['build_info']['callback_object']
    ->getFormID();
  drupal_form_submit($form_id, $form_state);
}