You are here

function entity_legal_document_acceptance_form_submit in Entity Legal 7

Same name and namespace in other branches
  1. 7.2 entity_legal.module \entity_legal_document_acceptance_form_submit()

Legal document acceptance submit handler.

File

./entity_legal.module, line 385
Entity Legal module.

Code

function entity_legal_document_acceptance_form_submit(&$form, &$form_state) {
  $entity_legal_document = $form_state[ENTITY_LEGAL_DOCUMENT_ENTITY_NAME];
  $published_version = $entity_legal_document
    ->getPublishedVersion();
  $acceptance = entity_create(ENTITY_LEGAL_DOCUMENT_ACCEPTANCE_ENTITY_NAME, array(
    'document_version_name' => $published_version
      ->identifier(),
  ));
  $acceptance
    ->save();
}