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 <guy@scopey.co.nz>
This commit is contained in:
Hels666 2019-09-06 09:31:22 +01:00 committed by Guy Marriott
parent 25de735a9f
commit 22a6a5b1e3

View File

@ -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 "<Surname>, <FirstName>".
* Falls back to showing either field on its own.