From f78c3ee5bb20c3950bf225726baf9ba66d97c2b6 Mon Sep 17 00:00:00 2001 From: Bram de Leeuw Date: Mon, 26 Sep 2022 16:57:39 +0200 Subject: [PATCH] Member updateName extension hook Allow updating the Member name from an extension --- src/Security/Member.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Security/Member.php b/src/Security/Member.php index 40b3ee577..cc68bfec6 100644 --- a/src/Security/Member.php +++ b/src/Security/Member.php @@ -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; }