當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。