Exponential Basic 2.4.0.1 Exponential Basic CMS — PHP Class Reference

repository.php
Go to the documentation of this file.
1 <?php
16 class ezpContentRepository
17 {
24 public static function query( ezpContentCriteria $criteria )
25 {
26 $fetchParams = self::translateFetchParams( $criteria );
27 $nodes = eZContentObjectTreeNode::subTreeByNodeID( $fetchParams->params, $fetchParams->rootNodeId );
28 $return = array();
29 foreach( $nodes as $node )
30 {
31 $return[] = ezpContent::fromNode( $node );
32 }
33 return $return;
34 }
35
41 public static function queryCount( ezpContentCriteria $criteria )
42 {
43 $fetchParams = self::translateFetchParams( $criteria );
44 $count = eZContentObjectTreeNode::subTreeCountByNodeID( $fetchParams->params, $fetchParams->rootNodeId );
45 return $count;
46 }
47
62 protected static function translateFetchParams( ezpContentCriteria $criteria )
63 {
64 $ret = new stdClass();
65 $ret->rootNodeId = array();
66 $ret->params = array();
67
74 // each criteria will translate to a method parameter, either in the $params array,
75 // or for the root location as $rootNodeId
76 foreach( $criteria->accept as $acceptCriteria )
77 {
78 $translatedCriteria = $acceptCriteria->translate();
79
80 switch( $translatedCriteria['type'] )
81 {
82 case 'location':
83 $ret->rootNodeId[] = $translatedCriteria['value'];
84 break;
85
86 case 'param':
87 // This implementation is really ugly... Need to change it
88 foreach( $translatedCriteria['name'] as $idx => $criteriaName )
89 {
90 $ret->params[$criteriaName] = $translatedCriteria['value'][$idx];
91 }
92 break;
93 }
94 }
95
96 // @TODO : Handle deny criterias
97 // foreach( $criteria->deny as $denyCriteria ) {}
98 return $ret;
99 }
100
125 public static function fetch( ezpContentIdentifier $identifier )
126 {
127
128 }
129
130 private static $defaultRootNode = 1;
131 }
132 ?>
ezpContentCriteria
Definition: criteria.php:29
ezpContentRepository
Definition: repository.php:17
ezpContentRepository\query
static query(ezpContentCriteria $criteria)
Definition: repository.php:24
ezpContentRepository\queryCount
static queryCount(ezpContentCriteria $criteria)
Definition: repository.php:41
ezpContentRepository\fetch
static fetch(ezpContentIdentifier $identifier)
Definition: repository.php:125
ezpContentRepository\$defaultRootNode
static $defaultRootNode
Definition: repository.php:130
ezpContentRepository\translateFetchParams
static translateFetchParams(ezpContentCriteria $criteria)
Definition: repository.php:62
ezpContent\fromNode
static fromNode(eZContentObjectTreeNode $node, $checkAccess=true)
Definition: private/api/content/content.php:73
$ret
$ret
Definition: ezsitemanager/admin/filelist.php:88
$count
$count
Definition: onlinetypelist.php:108
Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.