You are here

public function PrevNextApi::remove in Previous/Next API 8.2

Remove the prev_next records.

Parameters

int $entity_id: Entity id.

string $bundle_name: Entity type.

Overrides PrevNextApiInterface::remove

File

src/PrevNextApi.php, line 161

Class

PrevNextApi
Defines an PrevNextApi service.

Namespace

Drupal\prev_next

Code

public function remove($entity_id, $bundle_name) {

  // Delete the data for this node.
  $this->database
    ->delete('prev_next_node')
    ->condition('nid', $entity_id)
    ->execute();

  // Find out if any other nodes point to this node and update them.
  $this
    ->modifyPointingEntities($entity_id, $bundle_name);
}