コード例 #1
0
ファイル: DaseUser.php プロジェクト: rakeshraushan/dase
 public static function listAsAtom($db, $app_root, $limit = 100)
 {
     $users = new Dase_DBO_DaseUser($db);
     if ($limit) {
         $users->setLimit($limit);
     }
     $feed = new Dase_Atom_Feed();
     $feed->setTitle('DASe Users');
     $feed->setId($app_root . '/users');
     $feed->setFeedType('user_list');
     //todo:fix this to *not* simply be a time stamp
     $feed->setUpdated(date(DATE_ATOM));
     $feed->addAuthor();
     $feed->addLink($app_root . '/users.atom', 'self');
     $users->orderBy('updated DESC');
     foreach ($users->find() as $user) {
         $entry = $feed->addEntry();
         $entry->setTitle($user->name);
         $entry->setId($user->getUrl($app_root));
         $entry->setUpdated($user->updated);
         $entry->setEntryType('user');
         $entry->setContent($user->eid);
         $entry->addLink($user->getUrl($app_root) . '.atom', 'self');
     }
     return $feed->asXML($app_root);
 }