diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2016-03-25 17:54:22 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2016-03-25 17:54:22 +0100 |
commit | 8e128604b9bace8a834daa3b02f242f976df85e7 (patch) | |
tree | d520ad25a04ab839eec838fbde16e8cab1094240 /vendor/fguillot/picofeed/lib/PicoFeed/Parser/Item.php | |
parent | 7e9d8b396a87999b7abef7d08c6038af824a70e6 (diff) |
add makefile for building the project
Diffstat (limited to 'vendor/fguillot/picofeed/lib/PicoFeed/Parser/Item.php')
-rw-r--r-- | vendor/fguillot/picofeed/lib/PicoFeed/Parser/Item.php | 45 |
1 files changed, 42 insertions, 3 deletions
diff --git a/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Item.php b/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Item.php index 22d7c5951..34e557a11 100644 --- a/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Item.php +++ b/vendor/fguillot/picofeed/lib/PicoFeed/Parser/Item.php @@ -103,6 +103,18 @@ class Item public $namespaces = array(); /** + * Check if a XML namespace exists + * + * @access public + * @param string $namespace + * @return bool + */ + public function hasNamespace($namespace) + { + return array_key_exists($namespace, $this->namespaces); + } + + /** * Get specific XML tag or attribute value. * * @param string $tag Tag name (examples: guid, media:content) @@ -112,12 +124,10 @@ class Item */ public function getTag($tag, $attribute = '') { - // convert to xPath attribute query if ($attribute !== '') { $attribute = '/@'.$attribute; } - // construct query $query = './/'.$tag.$attribute; $elements = XmlParser::getXPathResult($this->xml, $query, $this->namespaces); @@ -155,7 +165,10 @@ class Item } /** - * Get url. + * Get URL + * + * @access public + * @return string */ public function getUrl() { @@ -163,6 +176,19 @@ class Item } /** + * Set URL + * + * @access public + * @param string $url + * @return Item + */ + public function setUrl($url) + { + $this->url = $url; + return $this; + } + + /** * Get id. */ public function getId() @@ -187,6 +213,19 @@ class Item } /** + * Set content + * + * @access public + * @param string $value + * @return Item + */ + public function setContent($value) + { + $this->content = $value; + return $this; + } + + /** * Get enclosure url. */ public function getEnclosureUrl() |