From ce3c3be1bf971329f82bedbf3aae636e3c8ecbf9 Mon Sep 17 00:00:00 2001 From: Zach Copley Date: Wed, 10 Feb 2010 14:24:16 -0800 Subject: Utility classes for atom feeds --- lib/atomnoticefeed.php | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 lib/atomnoticefeed.php (limited to 'lib/atomnoticefeed.php') diff --git a/lib/atomnoticefeed.php b/lib/atomnoticefeed.php new file mode 100644 index 000000000..a28c9cda7 --- /dev/null +++ b/lib/atomnoticefeed.php @@ -0,0 +1,34 @@ +addNamespace( + 'xmlns:thr', + 'http://purl.org/syndication/thread/1.0' + ); + } + + function addEntryFromNotices($notices) + { + if (is_array($notices)) { + foreach ($notices as $notice) { + $this->addEntryFromNotice($notice); + } + } else { + while ($notices->fetch()) { + $this->addEntryFromNotice($notice); + } + } + } + + function addEntryFromNotice($notice) + { + $this->addEntryRaw($notice->asAtomEntry()); + } + +} \ No newline at end of file -- cgit v1.2.3-54-g00ecf