You are here

public function GdprConsentAgreementController::save in General Data Protection Regulation 7

Overridden to care exportables that are overridden.

Overrides EntityAPIControllerExportable::save

File

modules/gdpr_consent/gdpr_consent.module, line 738
Contains hook implementations and shared functions.

Class

GdprConsentAgreementController
Custom controller for the gdpr_consent_agreement entity type.

Code

public function save($entity, DatabaseTransaction $transaction = NULL) {
  if (isset($entity->is_new)) {
    global $user;
    $entity->created = REQUEST_TIME;
    $entity->author_uid = $user->uid;
  }
  $entity->changed = REQUEST_TIME;

  // Always save new revisions.
  $entity->is_new_revision = TRUE;
  $entity->timestamp = REQUEST_TIME;
  $entity->revision_uid = $user->uid;
  return parent::save($entity, $transaction);
}