예제 #1
0
 function injectAtomEntryData(Dase_Atom_Entry $entry, $app_root)
 {
     $url = $this->getUrl($this->ascii_id, $app_root);
     $entry->setTitle($this->collection_name);
     $entry->setId($url);
     $entry->setUpdated($this->updated);
     $entry->addAuthor();
     $entry->addLink($url . '.atom');
     $entry->addLink($url . '.atom', 'edit');
     $entry->addCategory('collection', 'http://daseproject.org/category/entrytype');
     if ($this->description) {
         $entry->setSummary($this->description);
     } else {
         $entry->setSummary(str_replace('_collection', '', $this->ascii_id));
     }
     if ($this->admin_notes) {
         $entry->setContent($this->admin_notes);
     }
     foreach ($this->getAttributes() as $a) {
         $entry->addCategory($a->ascii_id, "http://daseproject.org/category/attribute", $a->attribute_name);
     }
     foreach ($this->getItemTypes() as $item_type) {
         $entry->addCategory($item_type->ascii_id, "http://daseproject.org/category/item_type", $item_type->name);
     }
     if ($this->is_public) {
         $pub = "public";
     } else {
         $pub = "private";
     }
     $entry->addCategory($pub, "http://daseproject.org/category/status");
     if (!$this->visibility) {
         $this->visibility = 'user';
     }
     $entry->addCategory($this->visibility, "http://daseproject.org/category/visibility");
     $entry->addCategory($app_root, "http://daseproject.org/category/base_url");
     $entry->addCategory($this->item_count, "http://daseproject.org/category/item_count");
     return $entry;
 }