Member updateName extension hook

Allow updating the Member name from an extension
This commit is contained in:
Bram de Leeuw 2022-09-26 16:57:39 +02:00 committed by GitHub
parent 52744c7848
commit f78c3ee5bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1217,7 +1217,9 @@ class Member extends DataObject
*/
public function getName()
{
return ($this->Surname) ? trim($this->FirstName . ' ' . $this->Surname) : $this->FirstName;
$name = ($this->Surname) ? trim($this->FirstName . ' ' . $this->Surname) : $this->FirstName;
$this->extend('updateName', $name);
return $name;
}