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


PHP core_kernel_classes_Resource::removePropertyValues方法代碼示例

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


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

示例1: remove

 /**
  * Short description of method remove
  *
  * @access public
  * @author Jehan Bihin, <jehan.bihin@tudor.lu>
  * @param  string roleUri
  * @param  string accessUri
  * @return mixed
  */
 public function remove($roleUri, $accessUri)
 {
     $uri = explode('#', $accessUri);
     list($type, $extId) = explode('_', $uri[1]);
     // Remove the access to the extension for this role.
     $extManager = common_ext_ExtensionsManager::singleton();
     $extension = $extManager->getExtensionById($extId);
     $role = new core_kernel_classes_Resource($roleUri);
     $role->removePropertyValues(new core_kernel_classes_Property(PROPERTY_ACL_GRANTACCESS), array('pattern' => $accessUri));
     funcAcl_helpers_Cache::flushExtensionAccess($extId);
     // also remove access to all the controllers
     $moduleAccessProperty = new core_kernel_classes_Property(PROPERTY_ACL_GRANTACCESS);
     $moduleAccessService = funcAcl_models_classes_ModuleAccessService::singleton();
     $grantedModules = $role->getPropertyValues($moduleAccessProperty);
     foreach ($grantedModules as $gM) {
         $gM = new core_kernel_classes_Resource($gM);
         $uri = explode('#', $gM->getUri());
         list($type, $ext) = explode('_', $uri[1]);
         if ($extId == $ext) {
             $moduleAccessService->remove($role->getUri(), $gM->getUri());
         }
     }
 }
開發者ID:swapnilaptara,項目名稱:tao-aptara-assess,代碼行數:32,代碼來源:class.ExtensionAccessService.php

示例2: deleteConnectorNextActivity

 /**
  * Short description of method deleteConnectorNextActivity
  *
  * @access public
  * @author Joel Bout, <joel.bout@tudor.lu>
  * @param  Resource connector
  * @param  string connectionType
  * @return mixed
  */
 public function deleteConnectorNextActivity(core_kernel_classes_Resource $connector, $connectionType = 'next')
 {
     $nextActivitiesProp = new core_kernel_classes_Property(PROPERTY_STEP_NEXT);
     $connectorService = wfEngine_models_classes_ConnectorService::singleton();
     switch ($connectionType) {
         case 'next':
             $property = $nextActivitiesProp;
             break;
         case 'then':
             $property = new core_kernel_classes_Property(PROPERTY_TRANSITIONRULES_THEN);
             break;
         case 'else':
             $property = new core_kernel_classes_Property(PROPERTY_TRANSITIONRULES_ELSE);
             break;
         default:
             throw new Exception('Trying to delete the value of an unauthorized connector property');
     }
     $activityRefProp = new core_kernel_classes_Property(PROPERTY_CONNECTORS_ACTIVITYREFERENCE);
     $activityRef = $connector->getUniquePropertyValue($activityRefProp)->getUri();
     if ($property->getUri() == PROPERTY_STEP_NEXT) {
         //manage the connection to the following activities
         $nextActivityCollection = $connector->getPropertyValuesCollection($property);
         foreach ($nextActivityCollection->getIterator() as $nextActivity) {
             if ($connectorService->isConnector($nextActivity)) {
                 $nextActivityRef = $nextActivity->getUniquePropertyValue($activityRefProp)->getUri();
                 if ($nextActivityRef == $activityRef) {
                     //delete following connectors only if they have the same activity reference
                     wfAuthoring_models_classes_ConnectorService::singleton()->delete($nextActivity);
                 }
             }
         }
         $connector->removePropertyValues($nextActivitiesProp);
     } elseif ($property->getUri() == PROPERTY_TRANSITIONRULES_THEN || $property->getUri() == PROPERTY_TRANSITIONRULES_ELSE) {
         //it is a split connector: get the transition rule, if exists
         $transitionRule = $connector->getOnePropertyValue(new core_kernel_classes_Property(PROPERTY_CONNECTORS_TRANSITIONRULE));
         if (!is_null($transitionRule)) {
             $nextActivity = $transitionRule->getOnePropertyValue($property);
             if (!is_null($nextActivity)) {
                 if ($connectorService->isConnector($nextActivity)) {
                     $nextActivityRef = $nextActivity->getUniquePropertyValue($activityRefProp)->getUri();
                     if ($nextActivityRef == $activityRef) {
                         //delete following connectors only if they have the same activity reference
                         wfAuthoring_models_classes_ConnectorService::singleton()->delete($nextActivity);
                     }
                 }
                 $connector->removePropertyValues($nextActivitiesProp, array('pattern' => $nextActivity->getUri()));
                 $transitionRule->removePropertyValues($property, array('pattern' => $nextActivity->getUri()));
             }
         }
     }
 }
開發者ID:oat-sa,項目名稱:extension-tao-wfauthoring,代碼行數:60,代碼來源:class.ProcessService.php

示例3: deleteToken

 /**
  * Delete password recovery token.
  * 
  * @param \core_kernel_classes_Resource $user
  * @return boolean
  */
 public function deleteToken(\core_kernel_classes_Resource $user)
 {
     $tokenProperty = new \core_kernel_classes_Property(self::PROPERTY_PASSWORD_RECOVERY_TOKEN);
     return $user->removePropertyValues($tokenProperty);
 }
開發者ID:nagyist,項目名稱:tao-core,代碼行數:11,代碼來源:PasswordRecoveryService.php

示例4: switchType

 /**
  * 
  * @author Lionel Lecaque, lionel@taotesting.com
  * @param core_kernel_classes_Resource $resource
  * @param string $newType
  */
 public static function switchType(core_kernel_classes_Resource $resource, $newType)
 {
     $resource->removePropertyValues(new core_kernel_classes_Property(RDF_TYPE));
     $resource->setPropertyValue(new core_kernel_classes_Property(RDF_TYPE), $newType);
 }
開發者ID:llecaque,項目名稱:extension-tao-update,代碼行數:11,代碼來源:class.UpdateDeliveryModel.php

示例5: unincludeRole

 /**
  * Uninclude a Role from antother Role.
  * 
  * @access public
  * @author Jerome Bogaerts, <jerome@taotesting.com>
  * @param core_kernel_classes_Resource role The Role from which you want to uninclude a Role.
  * @param core_kernel_classes_Resource roleToUninclude The Role to uninclude. 
  */
 public function unincludeRole(core_kernel_classes_Resource $role, core_kernel_classes_Resource $roleToUninclude)
 {
     $includesRoleProperty = new core_kernel_classes_Property(PROPERTY_ROLE_INCLUDESROLE);
     $role->removePropertyValues($includesRoleProperty, array('like' => false, 'pattern' => $roleToUninclude->getUri()));
     // invalidate cache for the role.
     if (GENERIS_CACHE_USERS_ROLES == true) {
         core_kernel_users_Cache::removeIncludedRoles($role);
         // For each roles that have $role for included role,
         // remove the cache entry.
         foreach ($this->getAllRoles() as $r) {
             $includedRoles = $this->getIncludedRoles($r);
             if (array_key_exists($role->getUri(), $includedRoles)) {
                 core_kernel_users_Cache::removeIncludedRoles($r);
             }
         }
     }
 }
開發者ID:oat-sa,項目名稱:generis,代碼行數:25,代碼來源:class.Service.php


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