You are here

public function DbtngExampleRepository::delete in Examples for Developers 8

Same name and namespace in other branches
  1. 3.x modules/dbtng_example/src/DbtngExampleRepository.php \Drupal\dbtng_example\DbtngExampleRepository::delete()

Delete an entry from the database.

Parameters

array $entry: An array containing at least the person identifier 'pid' element of the entry to delete.

See also

Drupal\Core\Database\Connection::delete()

File

dbtng_example/src/DbtngExampleRepository.php, line 123

Class

DbtngExampleRepository
Repository for database-related helper methods for our example.

Namespace

Drupal\dbtng_example

Code

public function delete(array $entry) {
  $this->connection
    ->delete('dbtng_example')
    ->condition('pid', $entry['pid'])
    ->execute();
}