You are here

public function EntityLegalDocumentAcceptanceController::create in Entity Legal 7

Same name and namespace in other branches
  1. 7.2 entity_legal.entity_controller.inc \EntityLegalDocumentAcceptanceController::create()

Implements EntityAPIControllerInterface.

Overrides EntityAPIController::create

File

./entity_legal.entity_controller.inc, line 207
Entity API controller classes for entity_legal module.

Class

EntityLegalDocumentAcceptanceController
Entity controller for legal document acceptance entity.

Code

public function create(array $values = array()) {
  if (empty($values['document_version_name'])) {
    throw new EntityFieldQueryException(t('Acceptance does not have a valid associated document version name'));
  }
  if (!isset($values['uid'])) {
    global $user;
    $values['uid'] = $user->uid;
  }
  $values['acceptance_date'] = time();
  return parent::create($values);
}