8
* This source file is subject to the new BSD license that is bundled
9
* with this package in the file LICENSE.txt.
10
* It is also available through the world-wide-web at this URL:
11
* http://framework.zend.com/license/new-bsd
12
* If you did not receive a copy of the license and are unable to
13
* obtain it through the world-wide-web, please send an email
14
* to license@zend.com so we can send you a copy immediately.
17
* @package Zend_Service
19
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
20
* @license http://framework.zend.com/license/new-bsd New BSD License
21
* @version $Id: LinkSet.php 8064 2008-02-16 10:58:39Z thomas $
26
* @see Zend_Service_Simpy_Link
28
require_once 'Zend/Service/Simpy/Link.php';
33
* @package Zend_Service
35
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
36
* @license http://framework.zend.com/license/new-bsd New BSD License
38
class Zend_Service_Simpy_LinkSet implements IteratorAggregate
43
* @var array of Zend_Service_Simpy_Link objects
48
* Constructor to initialize the object with data
50
* @param DOMDocument $doc Parsed response from a GetLinks operation
53
public function __construct(DOMDocument $doc)
55
$xpath = new DOMXPath($doc);
56
$list = $xpath->query('//links/link');
57
$this->_links = array();
59
for ($x = 0; $x < $list->length; $x++) {
60
$this->_links[$x] = new Zend_Service_Simpy_Link($list->item($x));
65
* Returns an iterator for the link set
67
* @return ArrayIterator
69
public function getIterator()
71
return new ArrayIterator($this->_links);
75
* Returns the number of links in the set
79
public function getLength()
81
return count($this->_links);