From 432abfdaa659b024b2d95f4b61fc764d9b8c426c Mon Sep 17 00:00:00 2001 From: Ishan Jayamanne Date: Wed, 6 Nov 2024 21:50:44 +1300 Subject: [PATCH] Enable updateDescription to override the Description --- src/Models/EmailLink.php | 5 ++++- src/Models/ExternalLink.php | 5 ++++- src/Models/PhoneLink.php | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Models/EmailLink.php b/src/Models/EmailLink.php index 2a84053d..9c80e8da 100644 --- a/src/Models/EmailLink.php +++ b/src/Models/EmailLink.php @@ -45,7 +45,10 @@ public function getCMSCompositeValidator(): CompositeValidator public function getDescription(): string { - return $this->Email ?: ''; + $description = $this->Email ?: ''; + $this->extend('updateDescription', $description); + + return $description; } public function getURL(): string diff --git a/src/Models/ExternalLink.php b/src/Models/ExternalLink.php index 3ff49ddc..ae8b48e6 100644 --- a/src/Models/ExternalLink.php +++ b/src/Models/ExternalLink.php @@ -46,7 +46,10 @@ public function getCMSCompositeValidator(): CompositeValidator public function getDescription(): string { - return $this->ExternalUrl ?: ''; + $description = $this->ExternalUrl ?: ''; + $this->extend('updateDescription', $description); + + return $description; } public function getURL(): string diff --git a/src/Models/PhoneLink.php b/src/Models/PhoneLink.php index a89e9534..dd278ab8 100644 --- a/src/Models/PhoneLink.php +++ b/src/Models/PhoneLink.php @@ -40,7 +40,10 @@ public function getCMSCompositeValidator(): CompositeValidator public function getDescription(): string { - return $this->Phone ?: ''; + $description = $this->Phone ?: ''; + $this->extend('updateDescription', $description); + + return $description; } public function getURL(): string