function DbtngExampleRepository::delete

Same name in other branches
  1. 4.0.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

modules/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();
}