/docs/api/_cycle_8php_source.html
HTML | 145 lines | 144 code | 0 blank | 1 comment | 0 complexity | 010c1ad71008f85565d61a4363e88155 MD5 | raw file
Possible License(s): GPL-2.0, LGPL-3.0
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
- <title>openbiz: E:/E/GEAMP/www/openbiz/openbiz/others/Zend/View/Helper/Cycle.php Source File</title>
- <link href="tabs.css" rel="stylesheet" type="text/css"/>
- <link href="doxygen.css" rel="stylesheet" type="text/css"/>
- </head>
- <body>
- <!-- Generated by Doxygen 1.7.2 -->
- <div class="navigation" id="top">
- <div class="tabs">
- <ul class="tablist">
- <li><a href="main.html"><span>Main Page</span></a></li>
- <li><a href="pages.html"><span>Related Pages</span></a></li>
- <li><a href="namespaces.html"><span>Namespaces</span></a></li>
- <li><a href="annotated.html"><span>Data Structures</span></a></li>
- <li class="current"><a href="files.html"><span>Files</span></a></li>
- <li><a href="examples.html"><span>Examples</span></a></li>
- </ul>
- </div>
- <div class="tabs2">
- <ul class="tablist">
- <li><a href="files.html"><span>File List</span></a></li>
- </ul>
- </div>
- <div class="header">
- <div class="headertitle">
- <h1>E:/E/GEAMP/www/openbiz/openbiz/others/Zend/View/Helper/Cycle.php</h1> </div>
- </div>
- <div class="contents">
- <div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <?php
- <a name="l00031"></a><a class="code" href="class_zend___view___helper___cycle.html">00031</a> <span class="keyword">class </span><a class="code" href="class_zend___view___helper___cycle.html">Zend_View_Helper_Cycle</a> <span class="keyword">implements</span> Iterator
- <a name="l00032"></a>00032 {
- <a name="l00033"></a>00033
- <a name="l00038"></a>00038 <span class="keyword">const</span> DEFAULT_NAME = <span class="stringliteral">'default'</span>;
- <a name="l00039"></a>00039
- <a name="l00045"></a>00045 <span class="keyword">protected</span> $_pointers = array(self::DEFAULT_NAME =>-1) ;
- <a name="l00046"></a>00046
- <a name="l00052"></a>00052 <span class="keyword">protected</span> $_data = array(self::DEFAULT_NAME=>array());
- <a name="l00053"></a>00053
- <a name="l00059"></a>00059 <span class="keyword">protected</span> $_name = self::DEFAULT_NAME;
- <a name="l00060"></a>00060
- <a name="l00068"></a><a class="code" href="class_zend___view___helper___cycle.html#a8ceaa5442bdbea73a2b2f9d3360c0045">00068</a> <span class="keyword">public</span> function <a class="code" href="class_zend___view___helper___cycle.html#a8ceaa5442bdbea73a2b2f9d3360c0045">cycle</a>(array $data = array(), $name = self::DEFAULT_NAME)
- <a name="l00069"></a>00069 {
- <a name="l00070"></a>00070 <span class="keywordflow">if</span>(!empty($data))
- <a name="l00071"></a>00071 $this->_data[$name] = $data;
- <a name="l00072"></a>00072
- <a name="l00073"></a>00073 $this-><a class="code" href="class_zend___view___helper___cycle.html#a266cf9c3f3c2a6768c32940938e49fa9">setName</a>($name);
- <a name="l00074"></a>00074 <span class="keywordflow">return</span> $this;
- <a name="l00075"></a>00075 }
- <a name="l00076"></a>00076
- <a name="l00084"></a><a class="code" href="class_zend___view___helper___cycle.html#aac7c937d98b5b5dcf5601d65d5caa3c4">00084</a> <span class="keyword">public</span> function <a class="code" href="class_zend___view___helper___cycle.html#aac7c937d98b5b5dcf5601d65d5caa3c4">assign</a>(Array $data , $name = self::DEFAULT_NAME)
- <a name="l00085"></a>00085 {
- <a name="l00086"></a>00086 $this-><a class="code" href="class_zend___view___helper___cycle.html#a266cf9c3f3c2a6768c32940938e49fa9">setName</a>($name);
- <a name="l00087"></a>00087 $this->_data[$name] = $data;
- <a name="l00088"></a>00088 $this-><a class="code" href="class_zend___view___helper___cycle.html#ae619dcf2218c21549cb65d875bbc6c9c">rewind</a>();
- <a name="l00089"></a>00089 <span class="keywordflow">return</span> $this;
- <a name="l00090"></a>00090 }
- <a name="l00091"></a>00091
- <a name="l00098"></a><a class="code" href="class_zend___view___helper___cycle.html#a266cf9c3f3c2a6768c32940938e49fa9">00098</a> <span class="keyword">public</span> function <a class="code" href="class_zend___view___helper___cycle.html#a266cf9c3f3c2a6768c32940938e49fa9">setName</a>($name = self::DEFAULT_NAME)
- <a name="l00099"></a>00099 {
- <a name="l00100"></a>00100 $this->_name = $name;
- <a name="l00101"></a>00101
- <a name="l00102"></a>00102 <span class="keywordflow">if</span>(!isset($this->_data[$this->_name]))
- <a name="l00103"></a>00103 $this->_data[$this->_name] = array();
- <a name="l00104"></a>00104
- <a name="l00105"></a>00105 <span class="keywordflow">if</span>(!isset($this->_pointers[$this->_name]))
- <a name="l00106"></a>00106 $this-><a class="code" href="class_zend___view___helper___cycle.html#ae619dcf2218c21549cb65d875bbc6c9c">rewind</a>();
- <a name="l00107"></a>00107
- <a name="l00108"></a>00108 <span class="keywordflow">return</span> $this;
- <a name="l00109"></a>00109 }
- <a name="l00110"></a>00110
- <a name="l00117"></a><a class="code" href="class_zend___view___helper___cycle.html#a3d0963e68bb313b163a73f2803c64600">00117</a> <span class="keyword">public</span> function <a class="code" href="class_zend___view___helper___cycle.html#a3d0963e68bb313b163a73f2803c64600">getName</a>()
- <a name="l00118"></a>00118 {
- <a name="l00119"></a>00119 <span class="keywordflow">return</span> $this->_name;
- <a name="l00120"></a>00120 }
- <a name="l00121"></a>00121
- <a name="l00122"></a>00122
- <a name="l00128"></a><a class="code" href="class_zend___view___helper___cycle.html#aba0d5b303383fb5b1fabb5fd01cd3800">00128</a> <span class="keyword">public</span> function <a class="code" href="class_zend___view___helper___cycle.html#aba0d5b303383fb5b1fabb5fd01cd3800">getAll</a>()
- <a name="l00129"></a>00129 {
- <a name="l00130"></a>00130 <span class="keywordflow">return</span> $this->_data[$this->_name];
- <a name="l00131"></a>00131 }
- <a name="l00132"></a>00132
- <a name="l00138"></a><a class="code" href="class_zend___view___helper___cycle.html#a5558c5d549f41597377fa1ea8a1cefa3">00138</a> <span class="keyword">public</span> function <a class="code" href="class_zend___view___helper___cycle.html#a5558c5d549f41597377fa1ea8a1cefa3">toString</a>()
- <a name="l00139"></a>00139 {
- <a name="l00140"></a>00140 <span class="keywordflow">return</span> (<span class="keywordtype">string</span>) $this->_data[$this->_name][$this-><a class="code" href="class_zend___view___helper___cycle.html#a729e946b4ef600e71740113c6d4332c0">key</a>()];
- <a name="l00141"></a>00141 }
- <a name="l00142"></a>00142
- <a name="l00148"></a><a class="code" href="class_zend___view___helper___cycle.html#a7516ca30af0db3cdbf9a7739b48ce91d">00148</a> <span class="keyword">public</span> function <a class="code" href="class_zend___view___helper___cycle.html#a7516ca30af0db3cdbf9a7739b48ce91d">__toString</a>()
- <a name="l00149"></a>00149 {
- <a name="l00150"></a>00150 <span class="keywordflow">return</span> $this-><a class="code" href="class_zend___view___helper___cycle.html#a5558c5d549f41597377fa1ea8a1cefa3">toString</a>();
- <a name="l00151"></a>00151 }
- <a name="l00152"></a>00152
- <a name="l00158"></a><a class="code" href="class_zend___view___helper___cycle.html#acea62048bfee7b3cd80ed446c86fb78a">00158</a> <span class="keyword">public</span> function <a class="code" href="class_zend___view___helper___cycle.html#acea62048bfee7b3cd80ed446c86fb78a">next</a>()
- <a name="l00159"></a>00159 {
- <a name="l00160"></a>00160 $count = count($this->_data[$this->_name]);
- <a name="l00161"></a>00161 <span class="keywordflow">if</span> ($this->_pointers[$this->_name] == ($count - 1))
- <a name="l00162"></a>00162 $this->_pointers[$this->_name] = 0;
- <a name="l00163"></a>00163 <span class="keywordflow">else</span>
- <a name="l00164"></a>00164 $this->_pointers[$this->_name] = ++$this->_pointers[$this->_name];
- <a name="l00165"></a>00165 <span class="keywordflow">return</span> $this;
- <a name="l00166"></a>00166 }
- <a name="l00167"></a>00167
- <a name="l00173"></a><a class="code" href="class_zend___view___helper___cycle.html#a190535b88008d474b610585a5d9eb84c">00173</a> <span class="keyword">public</span> function <a class="code" href="class_zend___view___helper___cycle.html#a190535b88008d474b610585a5d9eb84c">prev</a>()
- <a name="l00174"></a>00174 {
- <a name="l00175"></a>00175 $count = count($this->_data[$this->_name]);
- <a name="l00176"></a>00176 <span class="keywordflow">if</span> ($this->_pointers[$this->_name] <= 0)
- <a name="l00177"></a>00177 $this->_pointers[$this->_name] = $count - 1;
- <a name="l00178"></a>00178 <span class="keywordflow">else</span>
- <a name="l00179"></a>00179 $this->_pointers[$this->_name] = --$this->_pointers[$this->_name];
- <a name="l00180"></a>00180 <span class="keywordflow">return</span> $this;
- <a name="l00181"></a>00181 }
- <a name="l00182"></a>00182
- <a name="l00188"></a><a class="code" href="class_zend___view___helper___cycle.html#a729e946b4ef600e71740113c6d4332c0">00188</a> <span class="keyword">public</span> function <a class="code" href="class_zend___view___helper___cycle.html#a729e946b4ef600e71740113c6d4332c0">key</a>()
- <a name="l00189"></a>00189 {
- <a name="l00190"></a>00190 <span class="keywordflow">if</span> ($this->_pointers[$this->_name] < 0)
- <a name="l00191"></a>00191 <span class="keywordflow">return</span> 0;
- <a name="l00192"></a>00192 <span class="keywordflow">else</span>
- <a name="l00193"></a>00193 <span class="keywordflow">return</span> $this->_pointers[$this->_name];
- <a name="l00194"></a>00194 }
- <a name="l00195"></a>00195
- <a name="l00201"></a><a class="code" href="class_zend___view___helper___cycle.html#ae619dcf2218c21549cb65d875bbc6c9c">00201</a> <span class="keyword">public</span> function <a class="code" href="class_zend___view___helper___cycle.html#ae619dcf2218c21549cb65d875bbc6c9c">rewind</a>()
- <a name="l00202"></a>00202 {
- <a name="l00203"></a>00203 $this->_pointers[$this->_name] = -1;
- <a name="l00204"></a>00204 <span class="keywordflow">return</span> $this;
- <a name="l00205"></a>00205 }
- <a name="l00206"></a>00206
- <a name="l00212"></a><a class="code" href="class_zend___view___helper___cycle.html#abb9f0d6adf1eb9b3b55712056861a247">00212</a> <span class="keyword">public</span> function <a class="code" href="class_zend___view___helper___cycle.html#abb9f0d6adf1eb9b3b55712056861a247">valid</a>()
- <a name="l00213"></a>00213 {
- <a name="l00214"></a>00214 <span class="keywordflow">return</span> isset($this->_data[$this->_name][$this-><a class="code" href="class_zend___view___helper___cycle.html#a729e946b4ef600e71740113c6d4332c0">key</a>()]);
- <a name="l00215"></a>00215 }
- <a name="l00216"></a>00216
- <a name="l00222"></a><a class="code" href="class_zend___view___helper___cycle.html#af343507d1926e6ecf964625d41db528c">00222</a> <span class="keyword">public</span> function <a class="code" href="class_zend___view___helper___cycle.html#af343507d1926e6ecf964625d41db528c">current</a>()
- <a name="l00223"></a>00223 {
- <a name="l00224"></a>00224 <span class="keywordflow">return</span> $this->_data[$this->_name][$this-><a class="code" href="class_zend___view___helper___cycle.html#a729e946b4ef600e71740113c6d4332c0">key</a>()];
- <a name="l00225"></a>00225 }
- <a name="l00226"></a>00226 }
- </pre></div></div>
- </div>
- <hr class="footer"/><address class="footer"><small>Generated on Thu Apr 19 2012 17:01:18 for openbiz by 
- <a href="http://www.doxygen.org/index.html">
- <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.2 </small></address>
- </body>
- </html>