当前位置: 首页>>代码示例>>PHP>>正文


PHP eZSession::get方法代码示例

本文整理汇总了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;
    }
开发者ID:sushilbshinde,项目名称:ezpublish-study,代码行数:17,代码来源:mmUserData.php

示例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;
 }
开发者ID:nlescure,项目名称:ezpublish,代码行数:15,代码来源:ezxformtoken.php

示例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;
     }
 }
开发者ID:runelangseid,项目名称:ezpublish,代码行数:44,代码来源:ezuser.php

示例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);
}
开发者ID:philandteds,项目名称:bcimagealias,代码行数:30,代码来源:create.php

示例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;
 }
开发者ID:keyteqlabs,项目名称:ezote,代码行数:24,代码来源:Router.php


注:本文中的eZSession::get方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。