]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - lib/atomnoticefeed.php
a28c9cda7b678795be3e78695ccd093c5be9babf
[quix0rs-gnu-social.git] / lib / atomnoticefeed.php
1 <?php
2
3 class AtomNoticeFeed extends Atom10Feed
4 {
5     function __construct($indent = true) {
6         parent::__construct($indent);
7
8         // Feeds containing notice info use the Atom Threading Extensions
9
10         $this->addNamespace(
11             'xmlns:thr',
12             'http://purl.org/syndication/thread/1.0'
13         );
14     }
15
16     function addEntryFromNotices($notices)
17     {
18         if (is_array($notices)) {
19             foreach ($notices as $notice) {
20                 $this->addEntryFromNotice($notice);
21             }
22         } else {
23             while ($notices->fetch()) {
24                 $this->addEntryFromNotice($notice);
25             }
26         }
27     }
28
29     function addEntryFromNotice($notice)
30     {
31         $this->addEntryRaw($notice->asAtomEntry());
32     }
33
34 }