| @@ 28-39 (lines=12) @@ | ||
| 25 | * @param \DOMElement $element |
|
| 26 | * @return mixed |
|
| 27 | */ |
|
| 28 | public function setProperty(NodeInterface $node, \DOMElement $element) |
|
| 29 | { |
|
| 30 | if ($node instanceof ItemInterface) { |
|
| 31 | $author = $node->newAuthor(); |
|
| 32 | $author->setName($this->getAttributeValue($element, 'name')); |
|
| 33 | $author->setUri($this->getAttributeValue($element, 'uri')); |
|
| 34 | $author->setEmail($this->getAttributeValue($element, 'email')); |
|
| 35 | $node->setAuthor($author); |
|
| 36 | } |
|
| 37 | ||
| 38 | return $this; |
|
| 39 | } |
|
| 40 | ||
| 41 | /** |
|
| 42 | * creates the accurate DomElement content according to the $item's property |
|
| @@ 50-62 (lines=13) @@ | ||
| 47 | * @param \DOMElement $element |
|
| 48 | * @return $this |
|
| 49 | */ |
|
| 50 | public function setProperty(NodeInterface $node, \DOMElement $element) |
|
| 51 | { |
|
| 52 | if ($node instanceof ItemInterface) { |
|
| 53 | $media = $node->newMedia(); |
|
| 54 | $media->setType($this->getAttributeValue($element, 'type')) |
|
| 55 | ->setUrl($this->getAttributeValue($element, $this->getUrlAttributeName())) |
|
| 56 | ->setLength($this->getAttributeValue($element, 'length')); |
|
| 57 | ||
| 58 | $node->addMedia($media); |
|
| 59 | } |
|
| 60 | ||
| 61 | return $this; |
|
| 62 | } |
|
| 63 | ||
| 64 | /** |
|
| 65 | * creates the accurate DomElement content according to the $item's property |
|