You are here

public function RecentlyReadService::deleteRecords in Recently Read 8

Delete records from DB.

Parameters

array $records: Number of records to delete.

Overrides RecentlyReadServiceInterface::deleteRecords

1 call to RecentlyReadService::deleteRecords()
RecentlyReadService::insertEntity in src/RecentlyReadService.php
Custom function to insert or update an entry for recently read.

File

src/RecentlyReadService.php, line 144

Class

RecentlyReadService
Recently read service.

Namespace

Drupal\recently_read

Code

public function deleteRecords(array $records) {
  foreach ($records as $rid) {

    // Delete data.
    $recently_read = $this->recentlyReadStorage
      ->load($rid);
    $recently_read
      ->delete();
  }
}