Skip to content

Commit

Permalink
Merge pull request #7 from a-kovrigin/8.x-1.x
Browse files Browse the repository at this point in the history
Add the ability to override Element attributes.
  • Loading branch information
Niklan committed Jun 27, 2022
2 parents a8f5efa + 1e30d99 commit c3e5fc8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Xml/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,15 @@ public function getElementAttributes() {
return $this->attributes;
}

/**
* {@inheritDoc}
*/
public function setElementAttributes(array $attributes) {
$this->attributes = $attributes;

return $this;
}

/**
* {@inheritDoc}
*/
Expand Down
11 changes: 11 additions & 0 deletions src/Xml/ElementInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,17 @@ interface ElementInterface {
*/
public function getElementAttributes();

/**
* Sets element attributes.
*
* @param array $attributes
* An array with attribute elements.
*
* @return \Drupal\yandex_yml\Xml\ElementInterface
* The current instance of element.
*/
public function setElementAttributes(array $attributes);

/**
* Adds attribute for element.
*
Expand Down

0 comments on commit c3e5fc8

Please sign in to comment.