src/FeedIo/Rule/Atom/Category.php 1 location
|
@@ 41-49 (lines=9) @@
|
| 38 |
|
* @param CategoryInterface $category |
| 39 |
|
* @return \DomElement |
| 40 |
|
*/ |
| 41 |
|
public function createCategoryElement(\DomDocument $document, CategoryInterface $category) |
| 42 |
|
{ |
| 43 |
|
$element = $document->createElement($this->getNodeName()); |
| 44 |
|
$element->setAttribute('scheme', $category->getScheme()); |
| 45 |
|
$element->setAttribute('term', $category->getTerm()); |
| 46 |
|
$element->setAttribute('label', $category->getLabel()); |
| 47 |
|
|
| 48 |
|
return $element; |
| 49 |
|
} |
| 50 |
|
} |
| 51 |
|
|
src/FeedIo/Rule/Category.php 1 location
|
@@ 60-69 (lines=10) @@
|
| 57 |
|
* @param CategoryInterface $category |
| 58 |
|
* @return \DomElement |
| 59 |
|
*/ |
| 60 |
|
public function createCategoryElement(\DomDocument $document, CategoryInterface $category) |
| 61 |
|
{ |
| 62 |
|
$element = $document->createElement( |
| 63 |
|
$this->getNodeName(), |
| 64 |
|
is_null($category->getTerm()) ? $category->getLabel():$category->getTerm() |
| 65 |
|
); |
| 66 |
|
$element->setAttribute('domain', $category->getScheme()); |
| 67 |
|
|
| 68 |
|
return $element; |
| 69 |
|
} |
| 70 |
|
} |
| 71 |
|
|