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