Skip to content

Commit

Permalink
Add function to get first value in Element class
Browse files Browse the repository at this point in the history
  • Loading branch information
beatrycze-volk committed Jun 18, 2024
1 parent 6a74475 commit 1996268
Showing 1 changed file with 16 additions and 1 deletion.
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;
}
}

0 comments on commit 1996268

Please sign in to comment.