本文整理汇总了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);
}