本文整理汇总了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();
}
示例2: tearDown
public function tearDown()
{
// removes the created user
$user = new \core_kernel_classes_Resource($this->userUri);
$success = $user->delete();
$this->restoreCache();
}
示例3: deepDelete
public static function deepDelete(\core_kernel_classes_Resource $resource)
{
foreach ($resource->getRdfTriples() as $triple) {
self::deleteDependencies($triple);
}
$resource->delete();
}
示例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);
}
示例5: tearDown
/**
* tests clean up
*/
public function tearDown()
{
if (!is_null($this->testUser)) {
$this->testUser->delete();
}
}
示例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.'));
}
}
示例7: tearDown
public function tearDown()
{
$this->assertNotNull($this->currentUser);
$this->currentUser->delete();
}
示例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.");
}
}
示例9: tearDown
public function tearDown()
{
parent::tearDown();
$this->credentials->delete();
}
示例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;
}
示例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;
}
示例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);
示例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;
}
示例14: delete
/**
* (non-PHPdoc)
* @see taoTests_models_classes_TestModel::delete()
*/
public function delete(core_kernel_classes_Resource $content)
{
$content->delete();
}
示例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;
}