Permalink
Browse files

Add get_feed()/get_feeds() accessors

  • Loading branch information...
1 parent 7777ef3 commit f25e5a0945145bf329b665ea93deaaa9b37eddae @rmccue rmccue committed Dec 2, 2012
Showing with 27 additions and 0 deletions.
  1. +27 −0 library/SimplePie.php
View
@@ -1269,6 +1269,33 @@ public function get_encoding()
}
/**
+ * Get a feed object
+ *
+ * @param int $num The item that you want to return. Remember that arrays begin with 0, not 1
+ * @return SimplePie_Feed|null
+ */
+ public function get_feed($num = 0)
+ {
+ if (isset($this->multifeed_objects[$num]))
+ {
+ return $this->multifeed_objects[$num];
+ }
+ else {
+ return null;
+ }
+ }
+
+ /**
+ * Get all feeds
+ *
+ * @return array List of {@see SimplePIe_Feed} objects
+ */
+ public function get_feeds()
+ {
+ return $this->multifeed_objects;
+ }
+
+ /**
* Get a single item from the feed
*
* This is better suited for {@link http://php.net/for for()} loops, whereas

0 comments on commit f25e5a0

Please sign in to comment.