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


PHP core_kernel_classes_Resource::removePropertyValue方法代码示例

本文整理汇总了PHP中core_kernel_classes_Resource::removePropertyValue方法的典型用法代码示例。如果您正苦于以下问题:PHP core_kernel_classes_Resource::removePropertyValue方法的具体用法?PHP core_kernel_classes_Resource::removePropertyValue怎么用?PHP core_kernel_classes_Resource::removePropertyValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在core_kernel_classes_Resource的用法示例。


在下文中一共展示了core_kernel_classes_Resource::removePropertyValue方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: deleteContent

 /**
  * (non-PHPdoc)
  * @see taoTests_models_classes_TestModel::onTestModelSet()
  */
 public function deleteContent(core_kernel_classes_Resource $test)
 {
     $content = $test->getOnePropertyValue(new core_kernel_classes_Property(TEST_TESTCONTENT_PROP));
     if (!is_null($content)) {
         $content->delete();
         $test->removePropertyValue(new core_kernel_classes_Property(TEST_TESTCONTENT_PROP), $content);
     }
 }
开发者ID:nagyist,项目名称:extension-tao-testlti,代码行数:12,代码来源:class.LtiTestModel.php

示例2: saveGroups

 /**
  * Assign deliveries to groups
  *
  * @param \core_kernel_classes_Resource $delivery Delivery or RepeatedDelivery instance
  * @param array $values List of groups (uri)
  * @return boolean
  */
 public function saveGroups(\core_kernel_classes_Resource $delivery, $values)
 {
     $property = new \core_kernel_classes_Property(PROPERTY_GROUP_DELVIERY);
     $currentValues = array();
     foreach ($property->getDomain() as $domain) {
         $instances = $domain->searchInstances(array($property->getUri() => $delivery), array('recursive' => true, 'like' => false));
         $currentValues = array_merge($currentValues, array_keys($instances));
     }
     $toAdd = array_diff($values, $currentValues);
     $toRemove = array_diff($currentValues, $values);
     $success = true;
     foreach ($toAdd as $uri) {
         $subject = new \core_kernel_classes_Resource($uri);
         $success = $success && $subject->setPropertyValue($property, $delivery);
     }
     foreach ($toRemove as $uri) {
         $subject = new \core_kernel_classes_Resource($uri);
         $success = $success && $subject->removePropertyValue($property, $delivery);
     }
     return $success;
 }
开发者ID:oat-sa,项目名称:extension-tao-delivery-schedule,代码行数:28,代码来源:DeliveryGroupsService.php

示例3: deleteContent

 /**
  * Delete the content of a QTI test
  * @param core_kernel_classes_Resource $test
  * @throws common_exception_Error
  */
 public function deleteContent(core_kernel_classes_Resource $test)
 {
     $content = $test->getOnePropertyValue(new core_kernel_classes_Property(TEST_TESTCONTENT_PROP));
     if (!is_null($content)) {
         $file = new core_kernel_file_File($content);
         try {
             $path = $file->getAbsolutePath();
             if (is_dir($path)) {
                 if (!tao_helpers_File::delTree($path)) {
                     throw new common_exception_Error("Unable to remove test content directory located at '" . $file->getAbsolutePath() . "'.");
                 }
             }
         } catch (common_Exception $e) {
             // Empty file...
         }
         $file->delete();
         $test->removePropertyValue(new core_kernel_classes_Property(TEST_TESTCONTENT_PROP), $file);
     }
 }
开发者ID:nagyist,项目名称:extension-tao-testqti,代码行数:24,代码来源:class.QtiTestService.php

示例4: removeUser

 public function removeUser(\core_kernel_classes_Resource $user, core_kernel_classes_Resource $group)
 {
     return $user->removePropertyValue(new core_kernel_classes_Property(self::PROPERTY_MEMBERS_URI), $group);
 }
开发者ID:swapnilaptara,项目名称:tao-aptara-assess,代码行数:4,代码来源:GroupsService.php

示例5: deleteActualParameters

 /**
  * Short description of method deleteActualParameters
  *
  * @access public
  * @author Joel Bout, <joel.bout@tudor.lu>
  * @param  Resource callOfService
  * @return boolean
  */
 public function deleteActualParameters(core_kernel_classes_Resource $callOfService)
 {
     $propActualParamIn = new core_kernel_classes_Property(PROPERTY_CALLOFSERVICES_ACTUALPARAMETERIN);
     $propActualParamOut = new core_kernel_classes_Property(PROPERTY_CALLOFSERVICES_ACTUALPARAMETEROUT);
     foreach ($callOfService->getPropertyValuesCollection($propActualParamIn)->getIterator() as $actualParam) {
         $actualParam->delete();
         $callOfService->removePropertyValue($propActualParamIn, $actualParam);
     }
     foreach ($callOfService->getPropertyValuesCollection($propActualParamOut)->getIterator() as $actualParam) {
         $actualParam->delete();
         $callOfService->removePropertyValue($propActualParamOut, $actualParam);
     }
     return true;
 }
开发者ID:oat-sa,项目名称:extension-tao-wfauthoring,代码行数:22,代码来源:class.ProcessService.php

示例6: setReverseValues

 public function setReverseValues()
 {
     if (!tao_helpers_Request::isAjax()) {
         throw new common_exception_IsAjaxAction(__FUNCTION__);
     }
     $values = tao_helpers_form_GenerisTreeForm::getSelectedInstancesFromPost();
     $resource = new core_kernel_classes_Resource($this->getRequestParameter('resourceUri'));
     $property = new core_kernel_classes_Property($this->getRequestParameter('propertyUri'));
     $currentValues = array();
     foreach ($property->getDomain() as $domain) {
         $instances = $domain->searchInstances(array($property->getUri() => $resource), array('recursive' => true, 'like' => false));
         $currentValues = array_merge($currentValues, array_keys($instances));
     }
     $toAdd = array_diff($values, $currentValues);
     $toRemove = array_diff($currentValues, $values);
     $success = true;
     foreach ($toAdd as $uri) {
         $subject = new core_kernel_classes_Resource($uri);
         $success = $success && $subject->setPropertyValue($property, $resource);
     }
     foreach ($toRemove as $uri) {
         $subject = new core_kernel_classes_Resource($uri);
         $success = $success && $subject->removePropertyValue($property, $resource);
     }
     echo json_encode(array('saved' => $success));
 }
开发者ID:nagyist,项目名称:tao-core,代码行数:26,代码来源:class.GenerisTree.php

示例7: deleteContent

 /**
  * Delete the content of a QTI test
  * @param core_kernel_classes_Resource $test
  * @throws common_exception_Error
  */
 public function deleteContent(core_kernel_classes_Resource $test)
 {
     $content = $test->getOnePropertyValue($this->getProperty(TEST_TESTCONTENT_PROP));
     if (!is_null($content)) {
         $dir = $this->getFileReferenceSerializer()->unserialize($content);
         $dir->deleteSelf();
         $this->getFileReferenceSerializer()->cleanUp($content);
         $test->removePropertyValue($this->getProperty(TEST_TESTCONTENT_PROP), $content);
     }
 }
开发者ID:oat-sa,项目名称:extension-tao-testqti,代码行数:15,代码来源:class.QtiTestService.php


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