本文整理汇总了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());
}
}
}
示例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()));
}
}
}
}
示例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);
}
示例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);
}
示例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);
}
}
}
}