*prechod na novsiu verziu ZF
[sport-group.git] / library / Zend / Service / Simpy / Note.php
blob0940e9bb32f5c98cde836a0b6f53d8fcf155b0e6
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: Note.php 16211 2009-06-21 19:23:55Z thomas $
25 /**
26 * @category Zend
27 * @package Zend_Service
28 * @subpackage Simpy
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
34 /**
35 * Private access type
37 * @var string
39 const ACCESSTYPE_PRIVATE = 'private';
41 /**
42 * Public access type
44 * @var string
46 const ACCESSTYPE_PUBLIC = 'public';
48 /**
49 * Access type assigned to the note
51 * @var string
53 protected $_accessType;
55 /**
56 * ID of the note
58 * @var int
60 protected $_id;
62 /**
63 * URI of the note
65 * @var string
67 protected $_uri;
69 /**
70 * Date of the last modification made to the note
72 * @var string
74 protected $_modDate;
76 /**
77 * Date the note was added
79 * @var string
81 protected $_addDate;
83 /**
84 * Title of to the note
86 * @var string
88 protected $_title;
90 /**
91 * Tags assigned to the note
93 * @var array
95 protected $_tags;
97 /**
98 * Description of the note
100 * @var string
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
109 * @return void
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
139 * @return string
141 public function getAccessType()
143 return $this->_accessType;
147 * Returns the ID of the note
149 * @return int
151 public function getId()
153 return $this->_id;
157 * Returns the URI of the note
159 * @return string
161 public function getUri()
163 return $this->_uri;
167 * Returns the date of the last modification made to the note
169 * @return string
171 public function getModDate()
173 return $this->_modDate;
177 * Returns the date the note was added
179 * @return string
181 public function getAddDate()
183 return $this->_addDate;
187 * Returns the title assigned to the note
189 * @return string
191 public function getTitle()
193 return $this->_title;
197 * Returns the tags assigned to the note
199 * @return array
201 public function getTags()
203 return $this->_tags;
207 * Returns the description assigned to the note
209 * @return string
211 public function getDescription()
213 return $this->_description;