From 22a6a5b1e36e29b2935671a948360cd8ae9b132c Mon Sep 17 00:00:00 2001 From: Hels666 <37718606+Hels666@users.noreply.github.com> Date: Fri, 6 Sep 2019 09:31:22 +0100 Subject: [PATCH] NEW Add getLastName() method to Member.php (#9222) * Add getLastName() method to Member.php Add getLastName() method to Silverstripe\Security\Member.php to allow use of $LastName instead of $Surname in templates as it is a common mistake made this is for issue #9219 as discussed in Slack on 04-Sep-2019 * Minor doc block clean-up * Update src/Security/Member.php - typo fix Co-Authored-By: Guy Marriott --- src/Security/Member.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Security/Member.php b/src/Security/Member.php index 8109fbb45..d8275f9f6 100644 --- a/src/Security/Member.php +++ b/src/Security/Member.php @@ -1123,6 +1123,16 @@ class Member extends DataObject //------------------- HELPER METHODS -----------------------------------// + /** + * Simple proxy method to get the Surname property of the member + * + * @return string + */ + public function getLastName() + { + return $this->owner->Surname; + } + /** * Get the complete name of the member, by default in the format ", ". * Falls back to showing either field on its own.