PageRenderTime 41ms CodeModel.GetById 36ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

/framework/vendor/zend/Zend/Pdf/RecursivelyIteratableObjectsContainer.php

http://zoop.googlecode.com/
PHP | 45 lines | 14 code | 4 blank | 27 comment | 0 complexity | 6ba4754bf45d3c77ce806efae87d4567 MD5 | raw file
 1<?php
 2/**
 3 * Zend Framework
 4 *
 5 * LICENSE
 6 *
 7 * This source file is subject to the new BSD license that is bundled
 8 * with this package in the file LICENSE.txt.
 9 * It is also available through the world-wide-web at this URL:
10 * http://framework.zend.com/license/new-bsd
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
13 * to license@zend.com so we can send you a copy immediately.
14 *
15 * @category   Zend
16 * @package    Zend_Pdf
17 * @subpackage Actions
18 * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
19 * @license    http://framework.zend.com/license/new-bsd     New BSD License
20 * @version    $Id: RecursivelyIteratableObjectsContainer.php 20096 2010-01-06 02:05:09Z bkarwin $
21 */
22
23/**
24 * Iteratable objects container
25 *
26 * @package    Zend_Pdf
27 * @copyright  Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
28 * @license    http://framework.zend.com/license/new-bsd     New BSD License
29 */
30class Zend_Pdf_RecursivelyIteratableObjectsContainer implements RecursiveIterator, Countable
31{
32    protected $_objects = array();
33
34    public function __construct(array $objects) { $this->_objects = $objects; }
35
36    public function current()      { return current($this->_objects);            }
37    public function key()          { return key($this->_objects);                }
38    public function next()         { return next($this->_objects);               }
39    public function rewind()       { return reset($this->_objects);              }
40    public function valid()        { return current($this->_objects) !== false;  }
41    public function getChildren()  { return current($this->_objects);            }
42    public function hasChildren()  { return count($this->_objects) > 0;          }
43
44    public function count() { return count($this->_objects); }
45}