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