You are here

public function RedHenOrgInlineEntityFormController::entityFormSubmit in RedHen CRM 7

Overrides EntityInlineEntityFormController::entityFormSubmit().

Overrides EntityInlineEntityFormController::entityFormSubmit

File

modules/redhen_org/lib/redhen_org.inline_entity_form.inc, line 51
Defines the inline entity form controller for RedHen Orgs.

Class

RedHenOrgInlineEntityFormController
Class RedHenOrgInlineEntityFormController.

Code

public function entityFormSubmit(&$entity_form, &$form_state) {
  parent::entityFormSubmit($entity_form, $form_state);
  $org =& $entity_form['#entity'];

  // Set the contact's author uid.
  global $user;
  $org->author_uid = $user->uid;

  // Get form_state array, only including the subform of this entity.
  $child_form_state = form_state_defaults();
  $child_form_state['values'] = drupal_array_get_nested_value($form_state['values'], $entity_form['#parents']);

  // Save the org.
  $org
    ->save();
}