コード例 #1
0
 public function addCategory($term = 'default', $scheme = '', $label = '')
 {
     $newcategory = new AtomBuilderCategory($term);
     if (parent::isFilledString($scheme) == TRUE) {
         $newcategory->setScheme($scheme);
     }
     // end if
     if (parent::isFilledString($label) == TRUE) {
         $newcategory->setLabel($label);
     }
     // end if
     $this->categories->addObject($newcategory);
 }
コード例 #2
0
 protected function getCategory(AtomBuilderCategory $cat, $parentnode)
 {
     $newnode = $this->xml->createElement('category');
     $newnode->setAttribute('term', $cat->getTerm());
     if ($cat->getScheme() != FALSE) {
         $newnode->setAttribute('scheme', $cat->getScheme());
     }
     // end if
     if ($cat->getLabel() != FALSE) {
         $newnode->setAttribute('label', $cat->getLabel());
     }
     // end if
     $parentnode->appendChild($newnode);
 }