當前位置: 首頁>>代碼示例>>PHP>>正文


PHP core_kernel_classes_Resource::delete方法代碼示例

本文整理匯總了PHP中core_kernel_classes_Resource::delete方法的典型用法代碼示例。如果您正苦於以下問題:PHP core_kernel_classes_Resource::delete方法的具體用法?PHP core_kernel_classes_Resource::delete怎麽用?PHP core_kernel_classes_Resource::delete使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在core_kernel_classes_Resource的用法示例。


在下文中一共展示了core_kernel_classes_Resource::delete方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: tearDown

 public function tearDown()
 {
     if ($this->item) {
         $this->item->delete();
     }
     parent::tearDown();
 }
開發者ID:oat-sa,項目名稱:extension-tao-item,代碼行數:7,代碼來源:LocalItemSourceTest.php

示例2: tearDown

 public function tearDown()
 {
     // removes the created user
     $user = new \core_kernel_classes_Resource($this->userUri);
     $success = $user->delete();
     $this->restoreCache();
 }
開發者ID:oat-sa,項目名稱:tao-core,代碼行數:7,代碼來源:RestTestRunner.php

示例3: deepDelete

 public static function deepDelete(\core_kernel_classes_Resource $resource)
 {
     foreach ($resource->getRdfTriples() as $triple) {
         self::deleteDependencies($triple);
     }
     $resource->delete();
 }
開發者ID:kendaop,項目名稱:extension-tao-revision,代碼行數:7,代碼來源:DeleteHelper.php

示例4: setUp

 /**
  * tests initialization
  */
 public function setUp()
 {
     \common_ext_ExtensionsManager::singleton()->getExtensionById('taoTestTaker');
     TaoPhpUnitTestRunner::initTest();
     $this->proctorManagementService = ProctorManagementService::singleton();
     //clean test resources
     $proctor1 = new \core_kernel_classes_Resource('http://myTest.case#proctor1');
     $proctor2 = new \core_kernel_classes_Resource('http://myTest.case#proctor2');
     $proctor3 = new \core_kernel_classes_Resource('http://myTest.case#proctor3');
     $proctor1->delete(true);
     $proctor2->delete(true);
     $proctor3->delete(true);
 }
開發者ID:oat-sa,項目名稱:extension-tao-proctoring,代碼行數:16,代碼來源:ProctorManagementServiceTest.php

示例5: tearDown

 /**
  * tests clean up
  */
 public function tearDown()
 {
     if (!is_null($this->testUser)) {
         $this->testUser->delete();
     }
 }
開發者ID:nagyist,項目名稱:tao-core,代碼行數:9,代碼來源:PasswordRecoveryServiceTest.php

示例6: removeClassProperty

 /**
  * Render the add property sub form.
  * @throws Exception
  * @return void
  * @requiresRight classUri WRITE
  */
 public function removeClassProperty()
 {
     $success = false;
     if (!tao_helpers_Request::isAjax()) {
         throw new Exception("wrong request mode");
     }
     $class = new core_kernel_classes_Class($this->getRequestParameter('classUri'));
     $property = new core_kernel_classes_Property($this->getRequestParameter('uri'));
     //delete property mode
     foreach ($class->getProperties() as $classProperty) {
         if ($classProperty->equals($property)) {
             $indexes = $property->getPropertyValues(new core_kernel_classes_Property(INDEX_PROPERTY));
             //delete property and the existing values of this property
             if ($property->delete(true)) {
                 //delete index linked to the property
                 foreach ($indexes as $indexUri) {
                     $index = new core_kernel_classes_Resource($indexUri);
                     $index->delete(true);
                 }
                 $success = true;
                 break;
             }
         }
     }
     if ($success) {
         return $this->returnJson(array('success' => true));
     } else {
         $this->returnError(__('Unable to remove the property.'));
     }
 }
開發者ID:nagyist,項目名稱:tao-core,代碼行數:36,代碼來源:class.PropertiesAuthoring.php

示例7: tearDown

 public function tearDown()
 {
     $this->assertNotNull($this->currentUser);
     $this->currentUser->delete();
 }
開發者ID:nagyist,項目名稱:extension-tao-wfengine,代碼行數:5,代碼來源:NotificationServiceTest.php

示例8: removeLanguageFromOntology

 /**
  * Removes a language from the Ontology and all triples with the related
  * tag. Will use command line parameters for logic.
  *
  * @access protected
  * @author Joel Bout, <joel.bout@tudor.lu>
  * @return void
  */
 protected function removeLanguageFromOntology()
 {
     $this->outVerbose("Removing RDF language description '" . $this->options['language'] . "' from ontology...");
     $taoNS = 'http://www.tao.lu/Ontologies/TAO.rdf#';
     $expectedDescriptionUri = $taoNS . 'Lang' . $this->options['language'];
     $lgResource = new core_kernel_classes_Resource($expectedDescriptionUri);
     if (true === $lgResource->exists()) {
         $lgResource->delete();
         $this->outVerbose("RDF language description '" . $this->options['language'] . "' successfully removed.");
     } else {
         $this->outVerbose("RDF language description '" . $this->options['language'] . "' not found but considered removed.");
     }
 }
開發者ID:nagyist,項目名稱:tao-core,代碼行數:21,代碼來源:class.TaoTranslate.php

示例9: tearDown

 public function tearDown()
 {
     parent::tearDown();
     $this->credentials->delete();
 }
開發者ID:nagyist,項目名稱:tao-core,代碼行數:5,代碼來源:OauthTest.php

示例10: enable

 /**
  * Short description of method enable
  *
  * @access public
  * @author Jerome Bogaerts, <jerome@taotesting.com>
  * @return boolean
  */
 public function enable()
 {
     $returnValue = (bool) false;
     if ($this->authenticate()) {
         if ($this->checkout()) {
             // has root file?
             $rootFile = $this->getRootFile();
             if (!is_null($rootFile)) {
                 // delete the ressource, not the files
                 $ressource = new core_kernel_classes_Resource($rootFile);
                 $ressource->delete();
             }
             $rootFile = $this->createFile('');
             $this->editPropertyValues(new core_kernel_classes_Property(PROPERTY_GENERIS_VERSIONEDREPOSITORY_ROOTFILE), $rootFile);
             $this->editPropertyValues(new core_kernel_classes_Property(PROPERTY_GENERIS_VERSIONEDREPOSITORY_ENABLED), GENERIS_TRUE);
             common_Logger::i("The remote versioning repository " . $this->getUri() . " is bound to TAO.");
             core_kernel_fileSystem_Cache::flushCache();
             $returnValue = true;
         }
     }
     return (bool) $returnValue;
 }
開發者ID:oat-sa,項目名稱:generis,代碼行數:29,代碼來源:class.Repository.php

示例11: deleteOperation

 /**
  * Short description of method deleteOperation
  *
  * @access public
  * @author Joel Bout, <joel.bout@tudor.lu>
  * @param  Resource operation
  * @return boolean
  */
 public function deleteOperation(core_kernel_classes_Resource $operation)
 {
     $returnValue = (bool) false;
     $firstOperand = $operation->getOnePropertyValue(new core_kernel_classes_Property(PROPERTY_OPERATION_FIRST_OP));
     if (!is_null($firstOperand) && $firstOperand instanceof core_kernel_classes_Resource) {
         $this->deleteTerm($firstOperand);
     }
     $secondOperand = $operation->getOnePropertyValue(new core_kernel_classes_Property(PROPERTY_OPERATION_SECND_OP));
     if (!is_null($secondOperand) && $secondOperand instanceof core_kernel_classes_Resource) {
         $this->deleteTerm($secondOperand);
     }
     $returnValue = $operation->delete(true);
     return (bool) $returnValue;
 }
開發者ID:oat-sa,項目名稱:extension-tao-wfauthoring,代碼行數:22,代碼來源:class.ProcessService.php

示例12: json_encode

/*  
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; under version 2
 * of the License (non-upgradable).
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 * 
 * Copyright (c) 2008-2010 (original work) Deutsche Institut für Internationale Pädagogische Forschung (under the project TAO-TRANSFER);
 *               2009-2012 (update and modification) Public Research Centre Henri Tudor (under the project TAO-SUSTAIN & TAO-DEV);
 * 
 */
include_once dirname(__FILE__) . '/../../includes/raw_start.php';
if (!$_POST['uri']) {
    // missing parameters
    common_Logger::w('Missing param \'uri\'');
    return false;
}
$user = new core_kernel_classes_Resource($_POST['uri']);
$success = $user->delete();
if ($success) {
    common_Logger::i('Deleted user ' . $user->getUri());
}
echo json_encode($success);
開發者ID:nagyist,項目名稱:tao-core,代碼行數:31,代碼來源:tearDown.php

示例13: import

 /**
  * Short description of method import
  *
  * @access public
  * @author Cédric Alfonsi, <cedric.alfonsi@tudor.lu>
  * @param  Repository vcs
  * @param  string src
  * @param  string target
  * @param  string message
  * @param  array options
  * @return core_kernel_file_File
  */
 public function import(core_kernel_versioning_Repository $vcs, $src, $target, $message = "", $options = array())
 {
     $returnValue = null;
     //Save the imported resource in the onthology ?
     $saveResource = isset($options['saveResource']) && $options['saveResource'] ? true : false;
     //Import the folder in the repository
     $result = core_kernel_versioning_subversionWindows_Utils::exec($vcs, 'import -m "' . stripslashes($message) . '" "' . $src . '" "' . $target . '"');
     $repositoryUrl = $vcs->getUrl();
     $relativePath = substr($target, strlen($repositoryUrl));
     $folder = $vcs->createFile('', $relativePath);
     $folder->update();
     //Save a resource
     if ($saveResource) {
         $returnValue = $folder;
     } else {
         $resourceToDelete = new core_kernel_classes_Resource($folder);
         $resourceToDelete->delete();
     }
     return $returnValue;
 }
開發者ID:nagyist,項目名稱:generis,代碼行數:32,代碼來源:class.Repository.php

示例14: delete

 /**
  * (non-PHPdoc)
  * @see taoTests_models_classes_TestModel::delete()
  */
 public function delete(core_kernel_classes_Resource $content)
 {
     $content->delete();
 }
開發者ID:nagyist,項目名稱:extension-tao-deliverysimple,代碼行數:8,代碼來源:class.ContentModel.php

示例15: removeUser

 /**
  * Remove a Generis User from persistent memory. Bound roles will remain
  *
  * @access public
  * @author Jerome Bogaerts, <jerome@taotesting.com>
  * @param  Resource user A reference to the User to be removed from the persistent memory of Generis.
  * @return boolean
  */
 public function removeUser(core_kernel_classes_Resource $user)
 {
     $returnValue = (bool) false;
     $returnValue = $user->delete();
     return (bool) $returnValue;
 }
開發者ID:oat-sa,項目名稱:generis,代碼行數:14,代碼來源:class.Service.php


注:本文中的core_kernel_classes_Resource::delete方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。