diff -r 000000000000 -r 4eba9c11703f web/Zend/Service/Simpy/Link.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/Zend/Service/Simpy/Link.php Mon Dec 13 18:29:26 2010 +0100 @@ -0,0 +1,215 @@ + node from a parsed response from + * a GetLinks operation + * @return void + */ + public function __construct($node) + { + $this->_accessType = $node->attributes->getNamedItem('accessType')->nodeValue; + + $doc = new DOMDocument(); + $doc->appendChild($doc->importNode($node, true)); + $xpath = new DOMXPath($doc); + + $this->_url = $xpath->evaluate('/link/url')->item(0)->nodeValue; + $this->_modDate = $xpath->evaluate('/link/modDate')->item(0)->nodeValue; + $this->_addDate = $xpath->evaluate('/link/addDate')->item(0)->nodeValue; + $this->_title = $xpath->evaluate('/link/title')->item(0)->nodeValue; + $this->_nickname = $xpath->evaluate('/link/nickname')->item(0)->nodeValue; + $this->_note = $xpath->evaluate('/link/note')->item(0)->nodeValue; + + $list = $xpath->query('/link/tags/tag'); + $this->_tags = array(); + + for ($x = 0; $x < $list->length; $x++) { + $this->_tags[$x] = $list->item($x)->nodeValue; + } + } + + /** + * Returns the access type assigned to the link + * + * @see ACCESSTYPE_PRIVATE + * @see ACCESSTYPE_PUBLIC + * @return string + */ + public function getAccessType() + { + return $this->_accessType; + } + + /** + * Returns the URL of the link + * + * @return string + */ + public function getUrl() + { + return $this->_url; + } + + /** + * Returns the date of the last modification made to the link + * + * @return string + */ + public function getModDate() + { + return $this->_modDate; + } + + /** + * Returns the date the link was added + * + * @return string + */ + public function getAddDate() + { + return $this->_addDate; + } + + /** + * Returns the title assigned to the link + * + * @return string + */ + public function getTitle() + { + return $this->_title; + } + + /** + * Returns the nickname assigned to the link + * + * @return string + */ + public function getNickname() + { + return $this->_nickname; + } + + /** + * Returns the tags assigned to the link + * + * @return array + */ + public function getTags() + { + return $this->_tags; + } + + /** + * Returns the note assigned to the link + * + * @return string + */ + public function getNote() + { + return $this->_note; + } +}