当前位置: 首页>>代码示例>>PHP>>正文


PHP Repository::delete方法代码示例

本文整理汇总了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');
     }
 }
开发者ID:rmeruane,项目名称:repositorium,代码行数:18,代码来源:admin_repositories_controller.php

示例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));
 }
开发者ID:gekt,项目名称:www,代码行数:12,代码来源:RepositoryTest.php

示例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;
 }
开发者ID:jamesmoss,项目名称:flywheel,代码行数:19,代码来源:NestedRepository.php

示例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
 }
开发者ID:NaszvadiG,项目名称:activecollab_loc,代码行数:24,代码来源:RepositoryController.class.php

示例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();
开发者ID:jackpf,项目名称:ossim-arc,代码行数:31,代码来源:repository_delete.php

示例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);
     }
 }
开发者ID:NicolasLarrouy,项目名称:centreon,代码行数:22,代码来源:UserRepository.php

示例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));
开发者ID:nickel715,项目名称:phorkie,代码行数:19,代码来源:delete.php

示例8: testDelete

 public function testDelete()
 {
     $this->optionResourceMock->expects($this->once())->method('delete')->with($this->optionMock);
     $this->assertTrue($this->optionRepository->delete($this->optionMock));
 }
开发者ID:,项目名称:,代码行数:5,代码来源:

示例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();
}
开发者ID:jmoliver,项目名称:php-programando-com-orientacao-a-objeto,代码行数:25,代码来源:collection_delete.php


注:本文中的Repository::delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。