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


PHP eZPolicyLimitation::fetchByIdentifier方法代码示例

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


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

示例1: foreach

$nodeLimitation = eZPolicyLimitation::fetchByIdentifier( $policyID, 'Node' );
if ( $nodeLimitation != null )
{
    $nodeLimitationID = $nodeLimitation->attribute( 'id' );
    $nodeLimitationValues = eZPolicyLimitationValue::fetchList( $nodeLimitationID );
    foreach ( $nodeLimitationValues as $nodeLimitationValue )
    {
        $nodeID = $nodeLimitationValue->attribute( 'value' );
        $nodeIDList[] = $nodeID;
        $node = eZContentObjectTreeNode::fetch( $nodeID );
        $nodeList[] = $node;
    }
}

// Fetch subtree limitations
$subtreeLimitation = eZPolicyLimitation::fetchByIdentifier( $policyID, 'Subtree' );
if ( $subtreeLimitation != null )
{
    $subtreeLimitationID = $subtreeLimitation->attribute('id');
    $subtreeLimitationValues = eZPolicyLimitationValue::fetchList( $subtreeLimitationID );
    foreach ( $subtreeLimitationValues as $subtreeLimitationValue )
    {
        $subtreePath = $subtreeLimitationValue->attribute( 'value' );
        $subtreeObject = eZContentObjectTreeNode::fetchByPath( $subtreePath );
        if ( $subtreeObject )
        {
            $subtreeID = $subtreeObject->attribute( 'node_id' );
            if ( !isset( $subtreeIDList ) )
                $subtreeIDList = array();
            $subtreeIDList[] = $subtreeID;
            $subtree = eZContentObjectTreeNode::fetch( $subtreeID );
开发者ID:robinmuilwijk,项目名称:ezpublish,代码行数:31,代码来源:policyedit.php

示例2: array

         if (!in_array($nodeID, $nodeIDList)) {
             $nodeLimitationValue = eZPolicyLimitationValue::createNew($nodeLimitation->attribute('id'), $nodeID);
             $node = eZContentObjectTreeNode::fetch($nodeID);
             $nodeList[] = $node;
         }
     }
 }
 if ($http->hasPostVariable('SelectedNodeIDArray') and $http->postVariable('BrowseActionName') == 'FindLimitationSubtree' and !$http->hasPostVariable('BrowseCancelButton')) {
     $selectedSubtreeIDList = $http->postVariable('SelectedNodeIDArray');
     if ($http->hasSessionVariable('BrowsePolicyID')) {
         $policy = eZPolicy::fetch($http->sessionVariable('BrowsePolicyID'));
     } else {
         $policy = eZPolicy::createNew($roleID, array('ModuleName' => $currentModule, 'FunctionName' => $currentFunction, 'Limitation' => ''));
         $http->setSessionVariable('BrowsePolicyID', $policy->attribute('id'));
     }
     $subtreeLimitation = eZPolicyLimitation::fetchByIdentifier($policy->attribute('id'), 'Subtree');
     if ($subtreeLimitation == null) {
         $subtreeLimitation = eZPolicyLimitation::createNew($policy->attribute('id'), 'Subtree');
     }
     foreach ($selectedSubtreeIDList as $nodeID) {
         if (!in_array($nodeID, $subtreeIDList)) {
             $subtree = eZContentObjectTreeNode::fetch($nodeID);
             $pathString = $subtree->attribute('path_string');
             $policyLimitationValue = eZPolicyLimitationValue::createNew($subtreeLimitation->attribute('id'), $pathString);
             $subtreeList[] = $subtree;
         }
     }
 }
 if ($http->hasPostVariable('Limitation') && count($currentFunctionLimitations) == 0) {
     $currentModule = $http->postVariable('CurrentModule');
     $currentFunction = $http->postVariable('ModuleFunction');
开发者ID:mugoweb,项目名称:ezpublish-legacy,代码行数:31,代码来源:edit.php


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