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-2009 Zend Technologies USA Inc. (http://www.zend.com)
20 * @license http://framework.zend.com/license/new-bsd New BSD License
21 * @version $Id: Watchlist.php 16211 2009-06-21 19:23:55Z thomas $
26 * @see Zend_Service_Simpy_WatchlistFilterSet
28 require_once 'Zend/Service/Simpy/WatchlistFilterSet.php';
33 * @package Zend_Service
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_Watchlist
41 * Identifier for the watchlist
48 * Name of the watchlist
55 * Description of the watchlist
59 protected $_description;
62 * Timestamp for when the watchlist was added
69 * Number of new links in the watchlist
76 * List of usernames for users included in the watchlist
83 * List of filters included in the watchlist
85 * @var Zend_Service_Simpy_WatchlistFilterSet
90 * Constructor to initialize the object with data
92 * @param DOMNode $node Individual <watchlist> node from a parsed
93 * response from a GetWatchlists or GetWatchlist
97 public function __construct($node)
99 $map =& $node->attributes
;
101 $this->_id
= $map->getNamedItem('id')->nodeValue
;
102 $this->_name
= $map->getNamedItem('name')->nodeValue
;
103 $this->_description
= $map->getNamedItem('description')->nodeValue
;
104 $this->_addDate
= $map->getNamedItem('addDate')->nodeValue
;
105 $this->_newLinks
= $map->getNamedItem('newLinks')->nodeValue
;
107 $this->_users
= array();
108 $this->_filters
= new Zend_Service_Simpy_WatchlistFilterSet();
110 $childNode = $node->firstChild
;
111 while ($childNode !== null) {
112 if ($childNode->nodeName
== 'user') {
113 $this->_users
[] = $childNode->attributes
->getNamedItem('username')->nodeValue
;
114 } elseif ($childNode->nodeName
== 'filter') {
115 $filter = new Zend_Service_Simpy_WatchlistFilter($childNode);
116 $this->_filters
->add($filter);
118 $childNode = $childNode->nextSibling
;
123 * Returns the identifier for the watchlist
127 public function getId()
133 * Returns the name of the watchlist
137 public function getName()
143 * Returns the description of the watchlist
147 public function getDescription()
149 return $this->_description
;
153 * Returns a timestamp for when the watchlist was added
157 public function getAddDate()
159 return $this->_addDate
;
163 * Returns the number of new links in the watchlist
167 public function getNewLinks()
169 return $this->_newLinks
;
173 * Returns a list of usernames for users included in the watchlist
177 public function getUsers()
179 return $this->_users
;
183 * Returns a list of filters included in the watchlist
185 * @return Zend_Service_Simpy_WatchlistFilterSet
187 public function getFilters()
189 return $this->_filters
;