Overview

Packages

  • application
    • commands
    • components
      • actions
      • filters
      • leftWidget
      • permissions
      • sortableWidget
      • util
      • webupdater
      • x2flow
        • actions
        • triggers
      • X2GridView
      • X2Settings
    • controllers
    • models
      • embedded
    • modules
      • accounts
        • controllers
        • models
      • actions
        • controllers
        • models
      • calendar
        • controllers
        • models
      • charts
        • models
      • contacts
        • controllers
        • models
      • docs
        • components
        • controllers
        • models
      • groups
        • controllers
        • models
      • marketing
        • components
        • controllers
        • models
      • media
        • controllers
        • models
      • mobile
        • components
      • opportunities
        • controllers
        • models
      • products
        • controllers
        • models
      • quotes
        • controllers
        • models
      • services
        • controllers
        • models
      • template
        • models
      • users
        • controllers
        • models
      • workflow
        • controllers
        • models
      • x2Leads
        • controllers
        • models
  • Net
  • None
  • PHP
  • system
    • base
    • caching
      • dependencies
    • collections
    • console
    • db
      • ar
      • schema
        • cubrid
        • mssql
        • mysql
        • oci
        • pgsql
        • sqlite
    • i18n
      • gettext
    • logging
    • test
    • utils
    • validators
    • web
      • actions
      • auth
      • filters
      • form
      • helpers
      • renderers
      • services
      • widgets
        • captcha
        • pagers
  • Text
    • Highlighter
  • zii
    • behaviors
    • widgets
      • grid
      • jui

Classes

  • ActionFormModelBase
  • CActiveDataProvider
  • CalendarEventFormModel
  • CallFormModel
  • CArrayDataProvider
  • CAssetManager
  • CBaseController
  • CBaseUrlRule
  • CCacheHttpSession
  • CClientScript
  • CController
  • CCookieCollection
  • CDataProvider
  • CDataProviderIterator
  • CDbHttpSession
  • CExtController
  • CFormModel
  • CHttpCookie
  • CHttpRequest
  • CHttpSession
  • CHttpSessionIterator
  • COutputEvent
  • CPagination
  • CreatePageFormModel
  • CSort
  • CSqlDataProvider
  • CTheme
  • CThemeManager
  • CUploadedFile
  • CUrlManager
  • CUrlRule
  • CWebApplication
  • CWebModule
  • CWidgetFactory
  • EditMobileFormsFormModel
  • EventCommentPublisherFormModel
  • EventFormModel
  • EventPublisherFormModel
  • FileSystemObjectDataProvider
  • MassActionFormModel
  • MobilePagination
  • NoteFormModel
  • NotificationsController
  • TimeFormModel
  • UploadLogoFormModel
  • X2FormModel
  • X2HttpRequest

Interfaces

  • IDataProvider
  • IWidgetFactory
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * CHttpSessionIterator class file.
 4:  *
 5:  * @author Qiang Xue <qiang.xue@gmail.com>
 6:  * @link http://www.yiiframework.com/
 7:  * @copyright 2008-2013 Yii Software LLC
 8:  * @license http://www.yiiframework.com/license/
 9:  */
10: 
11: /**
12:  * CHttpSessionIterator implements an iterator for {@link CHttpSession}.
13:  *
14:  * It allows CHttpSession to return a new iterator for traversing the session variables.
15:  *
16:  * @author Qiang Xue <qiang.xue@gmail.com>
17:  * @package system.web
18:  * @since 1.0
19:  */
20: class CHttpSessionIterator implements Iterator
21: {
22:     /**
23:      * @var array list of keys in the map
24:      */
25:     private $_keys;
26:     /**
27:      * @var mixed current key
28:      */
29:     private $_key;
30: 
31:     /**
32:      * Constructor.
33:      * @param array the data to be iterated through
34:      */
35:     public function __construct()
36:     {
37:         $this->_keys=array_keys($_SESSION);
38:     }
39: 
40:     /**
41:      * Rewinds internal array pointer.
42:      * This method is required by the interface Iterator.
43:      */
44:     public function rewind()
45:     {
46:         $this->_key=reset($this->_keys);
47:     }
48: 
49:     /**
50:      * Returns the key of the current array element.
51:      * This method is required by the interface Iterator.
52:      * @return mixed the key of the current array element
53:      */
54:     public function key()
55:     {
56:         return $this->_key;
57:     }
58: 
59:     /**
60:      * Returns the current array element.
61:      * This method is required by the interface Iterator.
62:      * @return mixed the current array element
63:      */
64:     public function current()
65:     {
66:         return isset($_SESSION[$this->_key])?$_SESSION[$this->_key]:null;
67:     }
68: 
69:     /**
70:      * Moves the internal pointer to the next array element.
71:      * This method is required by the interface Iterator.
72:      */
73:     public function next()
74:     {
75:         do
76:         {
77:             $this->_key=next($this->_keys);
78:         }
79:         while(!isset($_SESSION[$this->_key]) && $this->_key!==false);
80:     }
81: 
82:     /**
83:      * Returns whether there is an element at current position.
84:      * This method is required by the interface Iterator.
85:      * @return boolean
86:      */
87:     public function valid()
88:     {
89:         return $this->_key!==false;
90:     }
91: }
92: 
API documentation generated by ApiGen 2.8.0