You are here

public function MessageTypeUIController::entityFormSubmitBuildEntity in Message 7

Overridden to customize the field location.

Overrides EntityDefaultUIController::entityFormSubmitBuildEntity

File

includes/message.admin.inc, line 16
Message type editing UI.

Class

MessageTypeUIController
UI controller.

Code

public function entityFormSubmitBuildEntity($form, &$form_state) {

  // We cannot use entity_form_submit_build_entity() any more.
  $entity = $form_state['message_type'];

  // Extract form values.
  form_state_values_clean($form_state);
  foreach ($form_state['values'] as $key => $value) {
    if ($key != 'message_type_fields') {
      $entity->{$key} = $value;
    }
  }

  // Invoke all specified builders for copying form values to entity
  // properties.
  // @see entity_form_submit_build_entity()
  if (isset($form['#entity_builders'])) {
    foreach ($form['#entity_builders'] as $function) {
      $function('message_type', $entity, $form, $form_state);
    }
  }
  field_attach_submit('message_type', $entity, $form['message_type_fields'], $form_state);
  return $entity;
}