Skip to content
Snippets Groups Projects

History repository

Open Andrey Postnikov requested to merge issue/drupal-2081585:2081585-history-storage into 11.x
2 unresolved threads
Edited by Andrey Postnikov

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
114 $user_id = $this->currentUser->id();
115 $time = $this->time->getRequestTime();
116 $entity_id = $entity->id();
117 $entity_type_id = $entity->getEntityTypeId();
118 $this->connection->merge('history')
119 ->keys([
120 'uid' => $user_id,
121 'entity_id' => $entity_id,
122 'entity_type' => $entity_type_id,
123 ])
124 ->fields(['timestamp' => $time])
125 ->execute();
126 // Update cached value.
127 $this->memoryCache->set(
128 $this->buildCacheId($user_id, $entity_type_id, $entity_id),
129 $time, Cache::PERMANENT,
  • daffie
    daffie @daffie started a thread on the diff
  • 100 Cache::PERMANENT,
    101 $this->getCacheTags($user_id, $row->entity_id)
    102 );
    103 $entities_to_read[$row->entity_id] = $timestamp;
    104 }
    105
    106 return $entities + $entities_to_read;
    107 }
    108
    109 /**
    110 * {@inheritdoc}
    111 */
    112 public function updateLastViewed(EntityInterface $entity): HistoryRepositoryInterface {
    113 if ($this->currentUser->isAuthenticated()) {
    114 $user_id = $this->currentUser->id();
    115 $time = $this->time->getRequestTime();
  • Andrey Postnikov changed target branch from 9.2.x to 9.3.x

    changed target branch from 9.2.x to 9.3.x

  • Andrey Postnikov added 263 commits

    added 263 commits

    Compare with previous version

  • Andrey Postnikov changed target branch from 9.3.x to 11.x

    changed target branch from 9.3.x to 11.x

  • Please register or sign in to reply
    Loading