From 9457ba8b7d52274265fe1ddba837aa01b90936fa Mon Sep 17 00:00:00 2001 From: John Koster Date: Sun, 3 Mar 2024 11:21:34 -0600 Subject: [PATCH 1/2] Cache status method on Page instances --- src/Structures/Page.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/Structures/Page.php b/src/Structures/Page.php index 7455bd64d38..96170492f0b 100644 --- a/src/Structures/Page.php +++ b/src/Structures/Page.php @@ -39,6 +39,7 @@ class Page implements Arrayable, ArrayAccess, Augmentable, Entry, JsonSerializab protected $title; protected $depth; protected $data = []; + protected $status; public function __construct() { @@ -413,7 +414,11 @@ public function private() public function status() { - return optional($this->entry())->status(); + if ($this->status !== null) { + return $this->status; + } + + return $this->status = optional($this->entry())->status(); } public function blueprint() From ee19bbf35873b4f5f442a6f12ed86ba9a4a183ac Mon Sep 17 00:00:00 2001 From: Jason Varga Date: Tue, 12 Mar 2024 10:51:25 -0400 Subject: [PATCH 2/2] visibility --- src/Structures/Page.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Structures/Page.php b/src/Structures/Page.php index 96170492f0b..6fe6bc2538b 100644 --- a/src/Structures/Page.php +++ b/src/Structures/Page.php @@ -39,7 +39,7 @@ class Page implements Arrayable, ArrayAccess, Augmentable, Entry, JsonSerializab protected $title; protected $depth; protected $data = []; - protected $status; + private $status; public function __construct() {