Пример #1
0
 /**
  * Parse category elements.
  * We may have more than one.
  *
  * @param SimpleXMLElement $element
  * @param ItemInInterface $item
  */
 protected function parseCategories(SimpleXMLElement $element, ItemInInterface $item)
 {
     foreach ($element->category as $xmlCategory) {
         $category = new Category();
         $category->setName((string) $xmlCategory);
         $item->addCategory($category);
     }
 }
Пример #2
0
 /**
  * Parse category elements.
  * We may have more than one.
  *
  * @param SimpleXMLElement $element
  * @param ItemInInterface $item
  */
 protected function parseCategories(SimpleXMLElement $element, ItemInInterface $item)
 {
     foreach ($element->category as $xmlCategory) {
         $category = new Category();
         $category->setName($this->getAttributeValue($xmlCategory, 'term'));
         $item->addCategory($category);
     }
 }