本文整理汇总了PHP中core_kernel_classes_Class::removePropertyValues方法的典型用法代码示例。如果您正苦于以下问题:PHP core_kernel_classes_Class::removePropertyValues方法的具体用法?PHP core_kernel_classes_Class::removePropertyValues怎么用?PHP core_kernel_classes_Class::removePropertyValues使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类core_kernel_classes_Class
的用法示例。
在下文中一共展示了core_kernel_classes_Class::removePropertyValues方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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, $ext, $mod, $act) = explode('_', $uri[1]);
$role = new core_kernel_classes_Class($roleUri);
$actionAccessProperty = new core_kernel_classes_Property(funcAcl_models_classes_AccessService::PROPERTY_ACL_GRANTACCESS);
$module = new core_kernel_classes_Resource($this->makeEMAUri($ext, $mod));
$controllerClassName = funcAcl_helpers_Map::getControllerFromUri($module->getUri());
// access via controller?
$controllerAccess = funcAcl_helpers_Cache::getControllerAccess($controllerClassName);
if (in_array($roleUri, $controllerAccess['module'])) {
// remove access to controller
funcAcl_models_classes_ModuleAccessService::singleton()->remove($roleUri, $module->getUri());
// add access to all other actions
foreach (funcAcl_helpers_Model::getActions($module) as $action) {
if ($action->getUri() != $accessUri) {
$this->add($roleUri, $action->getUri());
$this->getEventManager()->trigger(new AccessRightAddedEvent($roleUri, $action->getUri()));
}
}
} elseif (isset($controllerAccess['actions'][$act]) && in_array($roleUri, $controllerAccess['actions'][$act])) {
// remove action only
$role->removePropertyValues($actionAccessProperty, array('pattern' => $accessUri));
$this->getEventManager()->trigger(new AccessRightRemovedEvent($roleUri, $accessUri));
funcAcl_helpers_Cache::flushControllerAccess($controllerClassName);
}
}