Skip to content

Commit

Permalink
Merge pull request #23 from beatrycze-volk/get-by-index
Browse files Browse the repository at this point in the history
Get the element by index
  • Loading branch information
beatrycze-volk authored Jun 21, 2024
2 parents 6a74475 + 659700e commit b80bef9
Show file tree
Hide file tree
Showing 42 changed files with 5,266 additions and 2,606 deletions.
17 changes: 16 additions & 1 deletion src/Mods/Element/Xml/Element.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,19 @@ public function getValues(): array
}
return [];
}
}

/**
* Get first value of the queried element.
*
* @access public
*
* @return mixed
*/
public function getFirstValue()
{
if ($this->exists()) {
return $this->values[0];
}
return null;
}
}
Loading

0 comments on commit b80bef9

Please sign in to comment.