From 1d78ccfd9592f8c19633e8eb22403550ccbaa258 Mon Sep 17 00:00:00 2001 From: Duncan McClean Date: Fri, 8 Nov 2024 14:47:38 +0000 Subject: [PATCH] [5.x] Add `fullyQualifiedHandle` method to `Blueprint` (#11096) --- src/Fields/Blueprint.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Fields/Blueprint.php b/src/Fields/Blueprint.php index 2717299a08..57dd57e906 100644 --- a/src/Fields/Blueprint.php +++ b/src/Fields/Blueprint.php @@ -71,6 +71,19 @@ public function namespace(): ?string return $this->namespace; } + public function fullyQualifiedHandle(): string + { + $handle = $this->handle(); + + if ($this->namespace()) { + $handle = $this->isNamespaced() + ? $this->namespace().'::'.$handle + : $this->namespace().'.'.$handle; + } + + return $handle; + } + public function setOrder($order) { if (! is_null($order)) {