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: Note.php 16211 2009-06-21 19:23:55Z thomas $
27 * @package Zend_Service
29 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
30 * @license http://framework.zend.com/license/new-bsd New BSD License
32 class Zend_Service_Simpy_Note
39 const ACCESSTYPE_PRIVATE
= 'private';
46 const ACCESSTYPE_PUBLIC
= 'public';
49 * Access type assigned to the note
53 protected $_accessType;
70 * Date of the last modification made to the note
77 * Date the note was added
84 * Title of to the note
91 * Tags assigned to the note
98 * Description of the note
102 protected $_description;
105 * Constructor to initialize the object with data
107 * @param DOMNode $node Individual <link> node from a parsed response from
108 * a GetLinks operation
111 public function __construct($node)
113 $this->_accessType
= $node->attributes
->getNamedItem('accessType')->nodeValue
;
115 $doc = new DOMDocument();
116 $doc->appendChild($doc->importNode($node, true));
117 $xpath = new DOMXPath($doc);
119 $this->_uri
= $xpath->evaluate('/note/uri')->item(0)->nodeValue
;
120 $this->_id
= substr($this->_uri
, strrpos($this->_uri
, '=') +
1);
121 $this->_modDate
= trim($xpath->evaluate('/note/modDate')->item(0)->nodeValue
);
122 $this->_addDate
= trim($xpath->evaluate('/note/addDate')->item(0)->nodeValue
);
123 $this->_title
= $xpath->evaluate('/note/title')->item(0)->nodeValue
;
124 $this->_description
= $xpath->evaluate('/note/description')->item(0)->nodeValue
;
126 $list = $xpath->query('/note/tags/tag');
127 $this->_tags
= array();
129 for ($x = 0; $x < $list->length
; $x++
) {
130 $this->_tags
[$x] = $list->item($x)->nodeValue
;
135 * Returns the access type assigned to the note
137 * @see ACCESSTYPE_PRIVATE
138 * @see ACCESSTYPE_PUBLIC
141 public function getAccessType()
143 return $this->_accessType
;
147 * Returns the ID of the note
151 public function getId()
157 * Returns the URI of the note
161 public function getUri()
167 * Returns the date of the last modification made to the note
171 public function getModDate()
173 return $this->_modDate
;
177 * Returns the date the note was added
181 public function getAddDate()
183 return $this->_addDate
;
187 * Returns the title assigned to the note
191 public function getTitle()
193 return $this->_title
;
197 * Returns the tags assigned to the note
201 public function getTags()
207 * Returns the description assigned to the note
211 public function getDescription()
213 return $this->_description
;