From 60284479936d65443bd5dc14456bc0b692eab500 Mon Sep 17 00:00:00 2001 From: Jozef Selesi Date: Sat, 22 Nov 2008 18:22:53 +0000 Subject: An Atom library prototype. Its purpose is to explore the cost of us supporting Atom as the default input and output format of RESTful controllers. Only the constructs necessary for representing comment feeds and entries have been implemented. Its output are valid Atom 1.0 documents. The test contains examples of how to make feeds and entries. --- modules/atom/libraries/Atom_Feed.php | 49 ++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 modules/atom/libraries/Atom_Feed.php (limited to 'modules/atom/libraries/Atom_Feed.php') diff --git a/modules/atom/libraries/Atom_Feed.php b/modules/atom/libraries/Atom_Feed.php new file mode 100644 index 00000000..0b667e88 --- /dev/null +++ b/modules/atom/libraries/Atom_Feed.php @@ -0,0 +1,49 @@ +element->appendChild($this->dom->createElement("id", $id)); + return $this; + } + + public function title($title) { + $this->element->appendChild($this->dom->createElement("title", $title)); + return $this; + } + + public function updated($updated) { + $this->element->appendChild($this->dom->createElement("updated", $updated)); + return $this; + } + + public function link() { + return $this->add_child("Atom_Link", "link"); + } + + public function entry() { + /* Create new empty entry. */ + return $this->add_child("Atom_Entry", "entry"); + } + + public function append_entry($atom_entry) { + /* Append an exising entry. */ + $this->element->appendChild($atom_entry->get_element()); + } +} -- cgit v1.2.3