mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
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:
parent
25de735a9f
commit
22a6a5b1e3
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user