You are here

public function Activity::preSaveRevision in CRM Core 8

Same name and namespace in other branches
  1. 8.2 modules/crm_core_activity/src/Entity/Activity.php \Drupal\crm_core_activity\Entity\Activity::preSaveRevision()

Acts on a revision before it gets saved.

Parameters

EntityStorageInterface $storage: The entity storage object.

object $record: The revision object.

Overrides RevisionableInterface::preSaveRevision

File

modules/crm_core_activity/src/Entity/Activity.php, line 185

Class

Activity
CRM Activity Entity Class.

Namespace

Drupal\crm_core_activity\Entity

Code

public function preSaveRevision(EntityStorageInterface $storage, \stdClass $record) {
  parent::preSaveRevision($storage, $record);
  $account = \Drupal::currentUser();
  $record->uid = $account
    ->id();
}