. */ /** * Netvibes Bookmark. */ class Netvibes_Bookmark { /** * Bookmark title. * * @var string */ protected $_title; /** * Bookmark link. * * @var string */ protected $_link; /** * Bookmark tags. * * @var array */ protected $_tags; /** * Constructor from a XML element. * * @param SimpleXMLElement $xml */ public function __construct($xml) { $this->_title = (string) $xml->title; $this->_link = (string) $xml->link; $this->_tags = array(); foreach ($xml->xpath("tags/tag") as $tag) { $this->_tags[] = (string) $tag; } } /** * Sets the bookmark title. * * @param string $title */ public function setTitle($title) { $this->_title = $title; } /** * Returns the bookmark title. * * @return string */ public function getTitle() { return $this->_title; } /** * Sets the bookmark link. * * @param string $link */ public function setLink($link) { $this->_link = $link; } /** * Returns the bookmark link. * * @return string */ public function getLink() { return $this->_link; } /** * Sets the bookmark tags. * * @param array $data */ public function setTags(array $tags) { $this->_tags = $tags; } /** * Returns the bookmarks tags. * * @return array */ public function getTags() { return $this->_tags; } }