本文整理汇总了PHP中eZSession::get方法的典型用法代码示例。如果您正苦于以下问题:PHP eZSession::get方法的具体用法?PHP eZSession::get怎么用?PHP eZSession::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZSession
的用法示例。
在下文中一共展示了eZSession::get方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: instance
/**
* @return MMUserData
*/
public static function instance()
{
$instance = eZSession::get(self::SESSION_IDENTIFIER);
if (empty($instance))
{
return new self();
}
else
{
$instance = unserialize($instance);
}
return $instance;
}
示例2: getToken
/**
* Gets the user token from session if it exists or create+store
* it in session.
*
* @return string|null
*/
public static function getToken()
{
if (eZSession::issetkey(self::SESSION_KEY)) {
return eZSession::get(self::SESSION_KEY);
}
$token = md5(uniqid(self::SESSION_KEY, true));
eZSession::set(self::SESSION_KEY, $token);
return $token;
}
示例3: groups
function groups($asObject = false)
{
if ($asObject == true) {
if (!isset($this->GroupsAsObjects)) {
$db = eZDB::instance();
$contentobjectID = $this->attribute('contentobject_id');
$userGroups = $db->arrayQuery("SELECT d.*, c.path_string\n FROM ezcontentobject_tree b,\n ezcontentobject_tree c,\n ezcontentobject d\n WHERE b.contentobject_id='{$contentobjectID}' AND\n b.parent_node_id = c.node_id AND\n d.id = c.contentobject_id\n ORDER BY c.contentobject_id ");
$userGroupArray = array();
$pathArray = array();
foreach ($userGroups as $group) {
$pathItems = explode('/', $group["path_string"]);
array_pop($pathItems);
array_pop($pathItems);
foreach ($pathItems as $pathItem) {
if ($pathItem != '' && $pathItem > 1) {
$pathArray[] = $pathItem;
}
}
$userGroupArray[] = new eZContentObject($group);
}
$pathArray = array_unique($pathArray);
if (!empty($pathArray)) {
$extraGroups = $db->arrayQuery("SELECT d.*\n FROM ezcontentobject_tree c,\n ezcontentobject d\n WHERE c.node_id in ( " . implode(', ', $pathArray) . " ) AND\n d.id = c.contentobject_id\n ORDER BY c.contentobject_id ");
foreach ($extraGroups as $group) {
$userGroupArray[] = new eZContentObject($group);
}
}
$this->GroupsAsObjects = $userGroupArray;
}
return $this->GroupsAsObjects;
} else {
if (!isset($this->Groups)) {
// If the user object is not the currently logged in user we cannot use the session cache
$useCache = $this->ContentObjectID == eZSession::get('eZUserLoggedInID', self::anonymousId());
if ($useCache) {
$userCache = $this->getUserCache();
$this->Groups = $userCache['groups'];
} else {
$this->Groups = $this->generateGroupIdList();
}
}
return $this->Groups;
}
}
示例4: redirectToContentBrowseModuleView
/**
* Pass module view default template parameters
*
* @param array $parameters Array of parameters. Optional
* @param object $module Object of eZModule. Required
* @return string String of url to content/browse
*/
function redirectToContentBrowseModuleView($parameters = false, $module)
{
if ($parameters == false) {
// Fetch and use parameters from session directly
$parameters = eZSession::get('bcimagealias_create_parameters', $parameters);
}
/**
* Fetch array of container classes
*/
$classes = eZPersistentObject::fetchObjectList(eZContentClass::definition(), array('identifier'), array('is_container' => 1), null, null, false);
// as object
/**
* Prepare array of allowed class identifiers based on above fetch results
*/
$allowedClasses = array();
foreach ($classes as $class) {
$allowedClasses[] = $class['identifier'];
}
/**
* Return browse for node selection view limited to allowed classes
*/
return eZContentBrowse::browse(array('action_name' => 'BCImageAliasCreateAliasesAddNode', 'from_page' => '/bcimagealias/create', 'class_array' => $allowedClasses, 'persistent_data' => array('ParametersSerialized' => serialize($parameters))), $module);
}
示例5: handleEZXFormToken
/**
*
* Handles casese where the token is reset during a request.
*
* @param bool $restore
*
* @return bool
*
*/
public static function handleEZXFormToken($restore = false)
{
$activeExtensions = \eZExtension::activeExtensions();
if (in_array('ezformtoken', $activeExtensions)) {
if ($restore) {
if (isset(self::$ezxFormToken) && !empty(self::$ezxFormToken)) {
\eZSession::set(\ezxFormToken::SESSION_KEY, self::$ezxFormToken);
}
} else {
self::$ezxFormToken = \eZSession::get(\ezxFormToken::SESSION_KEY);
}
return self::$ezxFormToken;
}
return false;
}