You are here

public function CerUIController::overviewFormSubmit in Corresponding Entity References 7.3

Overview form submit callback.

Parameters

$form: The form array of the overview form.

$form_state: The overview form state which will be used for submitting.

Overrides EntityDefaultUIController::overviewFormSubmit

File

includes/CerUIController.inc, line 73

Class

CerUIController
Contains the controller class for CER's UI (i.e., preset management pages), used by Entity API.

Code

public function overviewFormSubmit($form, &$form_state) {
  foreach ($form_state['values']['table'] as $id => $values) {
    $preset = entity_object_load($id, $this->entityType);
    $preset->wrapper->cer_enabled
      ->set($values['cer_enabled'][LANGUAGE_NONE][0]['value']);
    $preset->wrapper->cer_bidirectional
      ->set($values['cer_bidirectional'][LANGUAGE_NONE][0]['value']);
    $preset->wrapper->cer_weight
      ->set($values['cer_weight'][LANGUAGE_NONE][0]['value']);
    $preset
      ->save();
  }
  drupal_set_message(t('The changes have been saved.'));
}