当前位置: 首页>>代码示例>>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;未经允许,请勿转载。