本文整理匯總了PHP中DatabaseConnection::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP DatabaseConnection::delete方法的具體用法?PHP DatabaseConnection::delete怎麽用?PHP DatabaseConnection::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類DatabaseConnection
的用法示例。
在下文中一共展示了DatabaseConnection::delete方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: delete
/**
* {@inheritdoc}
*/
public function delete($conditions)
{
if (!$conditions) {
return;
}
$path = $this->load($conditions);
$query = $this->db->delete('url_alias');
foreach ($conditions as $field => $value) {
if ($field == 'source' || $field == 'alias') {
// Use LIKE for case-insensitive matching (still stupid).
$query->condition($field, $this->db->escapeLike($value), 'LIKE');
} else {
if ('langcode' === $field) {
// Drupal 7 compat
$field = 'language';
}
$query->condition($field, $value);
}
}
$deleted = $query->execute();
// @todo Switch to using an event for this instead of a hook.
$this->moduleHandler->invokeAll('path_delete', [$path]);
\Drupal::service('path.alias_manager')->cacheClear();
return $deleted;
}
示例2: delete
/**
* {@inheritdoc}
*/
public function delete($name)
{
$existing = null;
if ($this->dispatcher) {
try {
$existing = $this->load($name);
} catch (\InvalidArgumentException $e) {
}
}
$this->db->delete('umenu')->condition('name', $name)->execute();
if ($this->dispatcher && $existing) {
$this->dispatcher->dispatch('menu:delete', new GenericEvent($existing));
}
}
示例3: delete
public function delete($table, array $options = array())
{
return $this->connection->delete($table, $options);
}
示例4: delete
/**
* @see DatabaseConnection::delete
*/
public function delete($where = '', $whereArgs = null, $limit = null)
{
return $this->dbc->delete($this->tblname, $where, $whereArgs, $limit);
}