本文整理汇总了PHP中UsuarioDAO::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP UsuarioDAO::delete方法的具体用法?PHP UsuarioDAO::delete怎么用?PHP UsuarioDAO::delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类UsuarioDAO
的用法示例。
在下文中一共展示了UsuarioDAO::delete方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetByEmail
public function testGetByEmail()
{
$data = $this->object->getByEmail('admin@admin.com');
$this->assertNotEmpty($data);
$this->assertEquals('admin@admin.com', $data['email']);
$email = 'randname' . rand() . '@test.com';
$this->assertEmpty($this->object->getByEmail($email));
$this->assertEquals(1, $this->object->novo($email, $email, hashit('password')));
$user = $this->object->getByEmail($email);
$this->assertNotEmpty($user);
$this->object->delete($user['id']);
$this->assertEmpty($this->object->getByEmail($email));
}
示例2: testeDelete
function testeDelete($id)
{
$resultado = false;
$conexao = ConnectionManager::getConexao();
$conexao->beginTransaction();
$dao = new UsuarioDAO();
if (!$dao->delete($conexao, $id)) {
$conexao->rollback();
} else {
$conexao->commit();
$resultado = true;
}
$conexao = null;
return $resultado;
}
示例3: delete
public function delete($id)
{
$resultado = false;
$conexao = null;
try {
$conexao = ConnectionManager::getConexao();
$conexao->beginTransaction();
$dao = new UsuarioDAO();
$resultado = $dao->delete($conexao, $id);
$conexao->commit();
} catch (Exception $ex) {
if ($conexao != null) {
$conexao->rollback();
}
echo $ex->getMessage();
} finally {
$conexao = null;
}
return $resultado;
}
示例4: deletarUsuario
function deletarUsuario($id)
{
$usuarioDAO = new UsuarioDAO();
$usuarioDAO->delete($id);
}