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


PHP eZPolicyLimitation::fetchByPolicyID方法代码示例

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


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

示例1: removeByValue

 static function removeByValue($value, $policyID = false)
 {
     if ($policyID) {
         $limitationIDList = array();
         $limitations = eZPolicyLimitation::fetchByPolicyID($policyID, false);
         foreach ($limitations as $limitationArray) {
             $limitationIDList[] = $limitationArray['id'];
         }
         if (count($limitationIDList) > 0) {
             eZPersistentObject::removeObject(eZPolicyLimitationValue::definition(), array('limitation_id' => array($limitationIDList), "value" => $value));
             return;
         }
     }
     eZPersistentObject::removeObject(eZPolicyLimitationValue::definition(), array("value" => $value));
 }
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:15,代码来源:ezpolicylimitationvalue.php

示例2: array

            $subtree = eZContentObjectTreeNode::fetch( $nodeID );
            $pathString = $subtree->attribute( 'path_string' );
            $policyLimitationValue = eZPolicyLimitationValue::createNew( $subtreeLimitation->attribute( 'id' ),  $pathString );
            $subtreeList[] = $subtree;
        }
    }
    $db->commit();
}

$currentLimitationList = array();
foreach ( $currentFunctionLimitations as $currentFunctionLimitation )
{
    $currentLimitationList[$currentFunctionLimitation['name']] = '-1';
}

$limitationList = eZPolicyLimitation::fetchByPolicyID( $policyID );
foreach ( $limitationList as $limitation )
{
    $limitationID = $limitation->attribute( 'id' );
    $limitationIdentifier = $limitation->attribute( 'identifier' );
    $limitationValueList = eZPolicyLimitationValue::fetchList( $limitationID );
    $valueList = array();
    foreach ( $limitationValueList as $limitationValue )
    {
        $valueList[] = $limitationValue->attribute( 'value' );
    }
    $currentLimitationList[$limitationIdentifier] = $valueList;
}

$Module->setTitle( 'Edit policy' );
$tpl = eZTemplate::factory();
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:31,代码来源:policyedit.php

示例3: fetchUserRole

 /**
  * Fetch policy list
  * Used by fetch( 'user', 'user_role', hash( 'user_id', $id ) ) template function.
  *
  * @param int $id User id or normal content object id in case of none user object (user group)
  * @return array(string=>array)
  */
 function fetchUserRole($id)
 {
     $user = eZUser::fetch($id);
     if ($user instanceof eZUser) {
         $roleList = $user->roles();
     } else {
         // user group or other non user classes:
         $roleList = eZRole::fetchByUser(array($id), true);
     }
     $accessArray = array();
     foreach (array_keys($roleList) as $roleKey) {
         $role = $roleList[$roleKey];
         $accessArray = array_merge_recursive($accessArray, $role->accessArray(true));
     }
     $resultArray = array();
     foreach ($accessArray as $moduleKey => $module) {
         $moduleName = $moduleKey;
         if ($moduleName != '*') {
             foreach ($module as $functionKey => $function) {
                 $functionName = $functionKey;
                 if ($functionName != '*') {
                     $hasLimitation = true;
                     foreach ($function as $limitationKey) {
                         if ($limitationKey == '*') {
                             $hasLimitation = false;
                             $limitationValue = '*';
                             $resultArray[] = array('moduleName' => $moduleName, 'functionName' => $functionName, 'limitation' => $limitationValue);
                         }
                     }
                     if ($hasLimitation) {
                         foreach ($function as $limitationKey => $limitation) {
                             if ($limitationKey !== '*') {
                                 $policyID = str_replace('p_', '', $limitationKey);
                                 $userRoleIdSeperator = strpos($policyID, '_');
                                 if ($userRoleIdSeperator !== false) {
                                     $policyID = substr($policyID, 0, $userRoleIdSeperator);
                                 }
                                 $limitationValue = eZPolicyLimitation::fetchByPolicyID($policyID);
                                 $resultArray[] = array('moduleName' => $moduleName, 'functionName' => $functionName, 'limitation' => $limitationValue);
                             } else {
                                 $limitationValue = '*';
                                 $resultArray[] = array('moduleName' => $moduleName, 'functionName' => $functionName, 'limitation' => $limitationValue);
                                 break;
                             }
                         }
                     }
                 } else {
                     $limitationValue = '*';
                     $resultArray[] = array('moduleName' => $moduleName, 'functionName' => $functionName, 'limitation' => $limitationValue);
                     break;
                 }
             }
         } else {
             $functionName = '*';
             $resultArray[] = array('moduleName' => '*', 'functionName' => $functionName, 'limitation' => '*');
             break;
         }
     }
     return array('result' => $resultArray);
 }
开发者ID:EVE-Corp-Center,项目名称:ECC-Website,代码行数:67,代码来源:ezuserfunctioncollection.php


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