You are here

function eck__entity__form_submit in Entity Construction Kit (ECK) 7

Same name and namespace in other branches
  1. 7.3 eck.entity.inc \eck__entity__form_submit()
  2. 7.2 eck.entity.inc \eck__entity__form_submit()

Submit function for entity form

Parameters

$form: Form array provided by the Form API

$form_state: array provided by the Form API

File

./eck.entity.inc, line 339
All the menus, pages, and functionality related to administering entities.

Code

function eck__entity__form_submit($form, &$form_state) {
  $entity = $form_state['values']['entity'];
  field_attach_form_validate($entity
    ->entityType(), $entity, $form, $form_state);
  field_attach_submit($entity
    ->entityType(), $entity, $form, $form_state);
  $entity
    ->save();
  drupal_set_message(t("Entity {$entity->id} - @entity_label has been saved", array(
    "@entity_label" => entity_label($form['#entity_type'], $entity),
  )));
}