本文整理汇总了PHP中eZContentClassClassGroup::fetchClassList方法的典型用法代码示例。如果您正苦于以下问题:PHP eZContentClassClassGroup::fetchClassList方法的具体用法?PHP eZContentClassClassGroup::fetchClassList怎么用?PHP eZContentClassClassGroup::fetchClassList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZContentClassClassGroup
的用法示例。
在下文中一共展示了eZContentClassClassGroup::fetchClassList方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getGroupedClasses
public static function getGroupedClasses()
{
/** @var ContainerInterface $container */
$container = ezpKernel::instance()->getServiceContainer();
$params = $container->getParameter('kaliop_class_select');
$classInclude = $classExclude = $groupInclude = $groupExclude = false;
$cgparams = array();
if (!empty($params['classes']['include'])) {
$classInclude = true;
$cgparams = $params['classes']['include'];
} elseif (!empty($params['classes']['exclude'])) {
$classExclude = true;
$cgparams = $params['classes']['exclude'];
} elseif (!empty($params['class_groups']['include'])) {
$groupInclude = true;
$cgparams = $params['class_groups']['include'];
} elseif (!empty($params['class_groups']['exclude'])) {
$groupExclude = true;
$cgparams = $params['class_groups']['exclude'];
}
$groups = eZContentClassGroup::fetchList(false, true);
$return = array();
$count = 0;
foreach ($groups as $group) {
if ($groupInclude and (in_array($group->attribute('id'), $cgparams) or in_array($group->attribute('name'), $cgparams)) or !$groupInclude and $groupExclude and (!in_array($group->attribute('id'), $cgparams) or !in_array($group->attribute('name'), $cgparams)) or !$groupInclude and !$groupExclude) {
$array = array('name' => $group->attribute('name'), 'classes' => array());
$count++;
$classes = eZContentClassClassGroup::fetchClassList(0, $group->attribute('id'), true);
foreach ($classes as $class) {
if ($classInclude and (in_array($class->attribute('id'), $cgparams) or in_array($class->attribute('identifier'), $cgparams)) or !$classInclude and $classExclude and (!in_array($class->attribute('id'), $cgparams) or !in_array($class->attribute('identifier'), $cgparams)) or !$classInclude and !$classExclude) {
$array['classes'][] = array('identifier' => $class->attribute('identifier'), 'name' => $class->attribute('name'));
$count++;
}
}
$return[] = $array;
}
}
return array('result' => array('groups' => $return, 'total' => $count));
}
示例2: fetchUserGroupClassNames
static function fetchUserGroupClassNames()
{
// Get names of user classes
$userClassNames = array();
$userClasses = eZUser::fetchUserClassList(false, array('identifier'));
foreach ($userClasses as $class) {
$userClassNames[] = $class['identifier'];
}
// Get names of all allowed content-classes for the Users subtree
$contentIni = eZINI::instance("content.ini");
$userGroupClassNames = array();
if ($contentIni->hasVariable('ClassGroupIDs', 'Users') and is_numeric($usersClassGroupID = $contentIni->variable('ClassGroupIDs', 'Users')) and count($usersClassList = eZContentClassClassGroup::fetchClassList(eZContentClass::VERSION_STATUS_DEFINED, $usersClassGroupID)) > 0) {
foreach ($usersClassList as $userClass) {
$userGroupClassNames[] = $userClass->attribute('identifier');
}
}
// Get names of user-group classes
$groupClassNames = array_diff($userGroupClassNames, $userClassNames);
return $groupClassNames;
}
示例3: array
* @license http://www.gnu.org/licenses/gpl-2.0.txt GNU General Public License v2
* @version 2012.6
* @package kernel
*/
$Module = $Params['Module'];
$http = eZHTTPTool::instance();
$deleteIDArray = $http->hasSessionVariable('DeleteGroupIDArray') ? $http->sessionVariable('DeleteGroupIDArray') : array();
$groupsInfo = array();
$deleteResult = array();
$deleteClassIDList = array();
foreach ($deleteIDArray as $deleteID) {
$deletedClassName = '';
$group = eZContentClassGroup::fetch($deleteID);
if ($group != null) {
$GroupName = $group->attribute('name');
$classList = eZContentClassClassGroup::fetchClassList(null, $deleteID);
$groupClassesInfo = array();
foreach ($classList as $class) {
$classID = $class->attribute("id");
$classGroups = eZContentClassClassGroup::fetchGroupList($classID, 0);
if (count($classGroups) == 1) {
$classObject = eZContentclass::fetch($classID);
$className = $classObject->attribute("name");
$deletedClassName .= " '" . $className . "'";
$deleteClassIDList[] = $classID;
$groupClassesInfo[] = array('class_name' => $className, 'object_count' => $classObject->objectCount());
}
}
if ($deletedClassName == '') {
$deletedClassName = ezpI18n::tr('kernel/class', '(no classes)');
}
示例4: foreach
$Module->setTitle( ezpI18n::tr( 'kernel/class', 'Class list of group' ) . ' ' . $GroupID );
$tpl = eZTemplate::factory();
$user = eZUser::currentUser();
foreach( $TemplateData as $tpldata )
{
$tplname = $tpldata["name"];
$groupInfo = eZContentClassGroup::fetch( $GroupID );
if( !$groupInfo )
{
return $Module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel' );
}
$list = eZContentClassClassGroup::fetchClassList( 0, $GroupID, $asObject = true );
$groupModifier = eZContentObject::fetch( $groupInfo->attribute( 'modifier_id') );
$tpl->setVariable( $tplname, $list );
$tpl->setVariable( "class_count", count( $list ) );
$tpl->setVariable( "GroupID", $GroupID );
$tpl->setVariable( "group", $groupInfo );
$tpl->setVariable( "group_modifier", $groupModifier );
}
$group = eZContentClassGroup::fetch( $GroupID );
$groupName = $group->attribute( 'name' );
$tpl->setVariable( "module", $Module );
$Result = array();