1 | <?php |
||
17 | class Author extends RuleAbstract |
||
18 | { |
||
19 | |||
20 | const NODE_NAME = 'author'; |
||
21 | |||
22 | /** |
||
23 | * @param NodeInterface $node |
||
24 | * @param \DOMElement $element |
||
25 | * @return mixed |
||
26 | */ |
||
27 | 2 | public function setProperty(NodeInterface $node, \DOMElement $element) |
|
28 | { |
||
29 | 2 | if ($node instanceof ItemInterface) { |
|
30 | 2 | $author = $node->newAuthor(); |
|
31 | 2 | $author->setName($this->getChildValue($element, 'name')); |
|
32 | 2 | $author->setUri($this->getChildValue($element, 'uri')); |
|
33 | 2 | $author->setEmail($this->getChildValue($element, 'email')); |
|
34 | 2 | $node->setAuthor($author); |
|
35 | 2 | } |
|
36 | |||
37 | 2 | return $this; |
|
38 | } |
||
39 | |||
40 | /** |
||
41 | * creates the accurate DomElement content according to the $item's property |
||
42 | * |
||
43 | * @param \DomDocument $document |
||
44 | * @param NodeInterface $node |
||
45 | * @return \DomElement |
||
46 | */ |
||
47 | 2 | public function createElement(\DomDocument $document, NodeInterface $node) |
|
60 | |||
61 | } |
||
62 |