本文整理汇总了PHP中eZUser::fetchUserClassList方法的典型用法代码示例。如果您正苦于以下问题:PHP eZUser::fetchUserClassList方法的具体用法?PHP eZUser::fetchUserClassList怎么用?PHP eZUser::fetchUserClassList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZUser
的用法示例。
在下文中一共展示了eZUser::fetchUserClassList方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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;
}
示例2: fetchExpiryNotificationPendingList
/**
* Fetch the eZPaEx objects that have their password about to expire
*
* @return array of eZPaEx objects corresponding to users that have to be notified
*/
static function fetchExpiryNotificationPendingList()
{
$currentTime = time();
$conds = array('expirationnotification_sent' => 0, 'passwordlifetime' => array('>', 0));
$customConds = ' AND (passwordlifetime *86400 - (' . $currentTime . ' - password_last_updated ) ) < expirationnotification ';
$userClassIDs = array();
foreach (eZUser::fetchUserClassList(true) as $userClass) {
$userClassIDs[] = $userClass->attribute('id');
}
if (empty($userClassIDs)) {
return array();
}
$customConds .= ' AND ezcontentobject.id = contentobject_id ';
$customConds .= ' AND ' . eZDB::instance()->generateSQLINStatement($userClassIDs, 'ezcontentobject.contentclass_id');
return eZPersistentObject::fetchObjectList(eZPaEx::definition(), null, $conds, null, null, true, false, null, array('ezcontentobject'), $customConds);
}