Merge file:///media/external_data/workspace/web/sport-group
[sport-group.git] / library / Zend / Service / Simpy / NoteSet.php
blob0a4536e5a7fe195a5d2e1cb554996eb82f5c7422
1 <?php
3 /**
4 * Zend Framework
6 * LICENSE
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.
16 * @category Zend
17 * @package Zend_Service
18 * @subpackage Simpy
19 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
20 * @license http://framework.zend.com/license/new-bsd New BSD License
21 * @version $Id: NoteSet.php 16211 2009-06-21 19:23:55Z thomas $
25 /**
26 * @see Zend_Service_Simpy_Note
28 require_once 'Zend/Service/Simpy/Note.php';
31 /**
32 * @category Zend
33 * @package Zend_Service
34 * @subpackage Simpy
35 * @copyright Copyright (c) 2005-2009 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_NoteSet implements IteratorAggregate
40 /**
41 * List of notes
43 * @var array of Zend_Service_Simpy_Note objects
45 protected $_notes;
47 /**
48 * Constructor to initialize the object with data
50 * @param DOMDocument $doc Parsed response from a GetNotes operation
51 * @return void
53 public function __construct(DOMDocument $doc)
55 $xpath = new DOMXPath($doc);
56 $list = $xpath->query('//notes/note');
57 $this->_notes = array();
59 for ($x = 0; $x < $list->length; $x++) {
60 $this->_notes[$x] = new Zend_Service_Simpy_Note($list->item($x));
64 /**
65 * Returns an iterator for the note set
67 * @return ArrayIterator
69 public function getIterator()
71 return new ArrayIterator($this->_notes);
74 /**
75 * Returns the number of notes in the set
77 * @return int
79 public function getLength()
81 return count($this->_notes);