本文整理汇总了PHP中Repository::delete方法的典型用法代码示例。如果您正苦于以下问题:PHP Repository::delete方法的具体用法?PHP Repository::delete怎么用?PHP Repository::delete使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Repository
的用法示例。
在下文中一共展示了Repository::delete方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: remove
function remove($id = null)
{
if (is_null($id)) {
$this->e404();
}
if ($this->Repository->delete($id)) {
$this->Session->setFlash('Repository deleted successfuly');
CakeLog::write('activity', 'Repository [id=' . $id . '] deleted');
} else {
$this->Session->setFlash('An error ocurred deleting the repository', 'flash_errors');
}
if (Configure::read('App.subdomains')) {
$dom = Configure::read('App.domain');
$this->redirect("http://www.{$dom}/admin_repositories");
} else {
$this->redirect('index');
}
}
示例2: testDeletingDocuments
public function testDeletingDocuments()
{
$config = new Config('/tmp/flywheel');
$repo = new Repository('_pages', $config);
$id = 'delete_test';
$name = $id . '_' . sha1($id) . '.json';
$path = '/tmp/flywheel/_pages/' . $name;
file_put_contents($path, '');
$this->assertTrue(is_file($path));
$repo->delete($id);
$this->assertFalse(is_file($path));
}
示例3: delete
/**
* @inherit
*/
public function delete($id)
{
$result = parent::delete($id);
if ($id instanceof DocumentInterface) {
$id = $id->getId();
}
if (!$result || !$this->deleteEmptyDirs || !$this->isNestedId($id)) {
return $result;
}
$path = $this->getPathForDocument($id);
$dir = dirname($path);
if (file_exists($dir) && count(glob($dir . '/*')) === 0) {
rmdir($dir);
}
return $result;
}
示例4: delete
/**
* Delete repository
*
* @param null
* @return void
*
*/
function delete()
{
if (!$this->active_repository->canEdit($this->logged_user)) {
$this->httpError(HTTP_ERR_FORBIDDEN);
}
// if
$delete = $this->active_repository->delete(true);
CommitProjectObjects::delete("repository_id = '" . $this->active_repository->getId() . "'");
SourceUsers::delete("repository_id = '" . $this->active_repository->getId() . "'");
if ($delete && !is_error($delete)) {
flash_success('Repository has been successfully deleted');
$this->redirectToUrl(source_module_url($this->active_project));
} else {
$this->smarty->assign('errors', $delete);
}
// if
}
示例5: GET
* Otherwise you can read it here: http://www.gnu.org/licenses/gpl-2.0.txt
*
*/
require_once 'av_init.php';
Session::logcheck("configuration-menu", "Osvdb");
$user = $_SESSION["_user"];
$error = false;
$id_document = GET('id_document');
ossim_valid($id_document, OSS_DIGIT, 'illegal:' . _("Id_document"));
if (ossim_error()) {
$error_txt = ossim_get_error();
$error = true;
} else {
$db = new ossim_db();
$conn = $db->connect();
Repository::delete($conn, $id_document);
$db->close();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title> <?php
echo gettext("OSSIM Framework");
?>
</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<meta http-equiv="Pragma" CONTENT="no-cache"/>
<link rel="stylesheet" type="text/css" href="../style/av_common.css?t=<?php
echo Util::get_css_id();
示例6: delete
/**
*
* @param array $ids
* @param object $currentUser
*/
public static function delete($ids, $currentUser = '')
{
if (isset($currentUser) && $currentUser instanceof User && in_array($currentUser->getId(), $ids)) {
throw new Exception('You can\'t delete yourself', 4404);
}
if (!self::isLastAdmin($ids)) {
foreach ($ids as $id) {
$contact = User::getParameters($id, array('contact_id'));
if (isset($contact['contact_id'])) {
Contact::delete($contact['contact_id']);
}
}
parent::delete($ids);
} else {
throw new Exception('You can\'t delete the last admin', 4404);
}
}
示例7: Repository
<?php
namespace phorkie;
/**
* Delete paste or ask for deletion
*/
$reqWritePermissions = true;
require_once 'www-header.php';
$repo = new Repository();
$repo->loadFromRequest();
if (isset($_GET['confirm']) && $_GET['confirm'] == 1) {
if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
throw new Exception_Input('Deleting only possible via POST');
}
$repo->delete();
redirect(Tools::fullUrl());
}
render('delete', array('repo' => $repo));
示例8: testDelete
public function testDelete()
{
$this->optionResourceMock->expects($this->once())->method('delete')->with($this->optionMock);
$this->assertTrue($this->optionRepository->delete($this->optionMock));
}
示例9: LoggerTXT
<?php
require_once 'classes/api/Transaction.php';
require_once 'classes/api/Connection.php';
require_once 'classes/api/Expression.php';
require_once 'classes/api/Criteria.php';
require_once 'classes/api/Repository.php';
require_once 'classes/api/Record.php';
require_once 'classes/api/Filter.php';
require_once 'classes/api/Logger.php';
require_once 'classes/api/LoggerTXT.php';
require_once 'classes/model/Produto.php';
try {
Transaction::open('estoque');
Transaction::setLogger(new LoggerTXT('tmp/log_collection_delete.txt'));
$criteria = new Criteria();
$criteria->add(new Filter('descricao', 'like', '%WEBC%'), Expression::OR_OPERATOR);
$criteria->add(new Filter('descricao', 'like', '%FILMAD%'), Expression::OR_OPERATOR);
$repository = new Repository('Produto');
$repository->delete($criteria);
Transaction::close();
} catch (Exception $e) {
echo $e->getMessage();
Transaction::rollback();
}