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

  • CAttributeCollection
  • CConfiguration
  • CList
  • CListIterator
  • CMap
  • CMapIterator
  • CQueue
  • CQueueIterator
  • CStack
  • CStackIterator
  • CTypedList
  • CTypedMap
  • Overview
  • Package
  • Class
  • Tree
 1: <?php
 2: /**
 3:  * CQueueIterator 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:  * CQueueIterator implements an iterator for {@link CQueue}.
13:  *
14:  * It allows CQueue to return a new iterator for traversing the items in the queue.
15:  *
16:  * @author Qiang Xue <qiang.xue@gmail.com>
17:  * @package system.collections
18:  * @since 1.0
19:  */
20: class CQueueIterator implements Iterator
21: {
22:     /**
23:      * @var array the data to be iterated through
24:      */
25:     private $_d;
26:     /**
27:      * @var integer index of the current item
28:      */
29:     private $_i;
30:     /**
31:      * @var integer count of the data items
32:      */
33:     private $_c;
34: 
35:     /**
36:      * Constructor.
37:      * @param array $data the data to be iterated through
38:      */
39:     public function __construct(&$data)
40:     {
41:         $this->_d=&$data;
42:         $this->_i=0;
43:         $this->_c=count($this->_d);
44:     }
45: 
46:     /**
47:      * Rewinds internal array pointer.
48:      * This method is required by the interface Iterator.
49:      */
50:     public function rewind()
51:     {
52:         $this->_i=0;
53:     }
54: 
55:     /**
56:      * Returns the key of the current array item.
57:      * This method is required by the interface Iterator.
58:      * @return integer the key of the current array item
59:      */
60:     public function key()
61:     {
62:         return $this->_i;
63:     }
64: 
65:     /**
66:      * Returns the current array item.
67:      * This method is required by the interface Iterator.
68:      * @return mixed the current array item
69:      */
70:     public function current()
71:     {
72:         return $this->_d[$this->_i];
73:     }
74: 
75:     /**
76:      * Moves the internal pointer to the next array item.
77:      * This method is required by the interface Iterator.
78:      */
79:     public function next()
80:     {
81:         $this->_i++;
82:     }
83: 
84:     /**
85:      * Returns whether there is an item at current position.
86:      * This method is required by the interface Iterator.
87:      * @return boolean
88:      */
89:     public function valid()
90:     {
91:         return $this->_i<$this->_c;
92:     }
93: }
94: 
API documentation generated by ApiGen 2.8.0