本文整理汇总了PHP中DibiConnection::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP DibiConnection::delete方法的具体用法?PHP DibiConnection::delete怎么用?PHP DibiConnection::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DibiConnection
的用法示例。
在下文中一共展示了DibiConnection::delete方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: deleteId
/**
* @param $id numeric
*
* @throws Exception
*/
public function deleteId($id)
{
if (!is_numeric($id)) {
throw new Exception('Wrong DELETE parameter: Non-numeric ID not allowed');
}
$this->database->delete($this->table)->where('id = ?', (int) $id)->execute();
}
示例2: deleteItem
/**
* @param object $instance
* @param ClassMetadata $classMetadata
* @return \DibiResult|int
*/
private function deleteItem($instance, ClassMetadata $classMetadata)
{
$affectedRows = $this->dibiConnection->delete($classMetadata->getTable())->where($this->buildPrimaryKey($instance, $classMetadata))->execute(\dibi::AFFECTED_ROWS);
$classKey = $this->getEntityClassHashKey($instance);
unset($this->managedClasses[$classKey]);
return $affectedRows;
}
示例3: createModifyManyToMany
public function createModifyManyToMany(Association\ManyToMany $association, $primaryValue, array $refKeys, $action = self::ASSOC_ADD)
{
if ($action === self::ASSOC_ADD) {
$fluent = $this->connection->insert($association->getJoinResource(), [$association->getJoinKey() => array_fill(0, count($refKeys), $primaryValue), $association->getReferencingKey() => $refKeys]);
} else {
$fluent = $this->connection->delete($association->getJoinResource())->where("%n = %s", $association->getJoinKey(), $primaryValue)->and("%n IN %l", $association->getReferencingKey(), $refKeys);
}
$query = new Query($fluent);
$query->resultCallback = function (Query $query) {
return $query->fluent->execute();
};
return $query;
}
示例4: remove
/**
* Remove authorization code
* @param string $authorizationCode
* @return void
*/
public function remove($authorizationCode)
{
$this->context->delete($this->getTable())->where('authorization_code = %s', $authorizationCode)->execute();
}
示例5: tearDown
protected function tearDown()
{
$this->db->delete("pages")->execute();
$this->db->delete("connections")->execute();
$this->db->delete("tags")->execute();
}
示例6: delete
public function delete($id)
{
return $this->connection->delete($this->table)->where('id=%i', $id)->execute();
}
示例7: delete
/**
* @param int $id
* @return bool
*/
public function delete($id)
{
$this->database->delete(self::TABLE)->where(self::TABLE . '.id = %i', $id)->execute();
return $this->database->getAffectedRows() == 1;
}
示例8: remove
/**
* Remove refresh token
* @param string $refreshToken
*/
public function remove($refreshToken)
{
$this->context->delete($this->getTable())->where(array('refresh_token' => $refreshToken))->execute();
}