public function DataProviderDbQuery::remove in RESTful 7.2
Delete operation.
Parameters
mixed $identifier: The ID of thing to be removed.
Overrides CrudInterface::remove
File
- src/
Plugin/ resource/ DataProvider/ DataProviderDbQuery.php, line 340 - Contains \Drupal\restful\Plugin\resource\DataProvider\DataProviderDbQuery.
Class
Namespace
Drupal\restful\Plugin\resource\DataProviderCode
public function remove($identifier) {
// If it's a delete method we will want a 204 response code.
// Set the HTTP headers.
$this
->setHttpHeader('Status', 204);
$query = db_delete($this
->getTableName());
foreach ($this
->getIdColumn() as $index => $column) {
$query
->condition($column, current($this
->getColumnFromIds(array(
$identifier,
), $index)));
}
$query
->execute();
}