From 8fb04a64fe4972a58f66e0050af066eeeef4b260 Mon Sep 17 00:00:00 2001 From: jetwitaussi Date: Fri, 5 Nov 2021 08:09:58 +0100 Subject: [PATCH] Add getName on youth player --- PHT/Xml/Player/Youth.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/PHT/Xml/Player/Youth.php b/PHT/Xml/Player/Youth.php index b1304fa..2c0f364 100644 --- a/PHT/Xml/Player/Youth.php +++ b/PHT/Xml/Player/Youth.php @@ -60,6 +60,21 @@ public function getNickName() return $this->getXml()->getElementsByTagName('NickName')->item(0)->nodeValue; } + /** + * Return player full name + * + * @return string + */ + public function getName() + { + $name = $this->getFirstName() . ' '; + if ($this->getNickName() !== null && $this->getNickName() !== '') { + $name .= $this->getNickName() . ' '; + } + $name .= $this->getLastName(); + return $name; + } + /** * Return youth player age *