Skip to content

Commit 1463c6a

Browse files
authored
Merge pull request #26 from 5am-code/feature/page-url
add url to page
2 parents 3683d2c + 27f61a6 commit 1463c6a

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/Entities/Page.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ class Page extends Entity
3131
*/
3232
protected string $title = '';
3333

34+
/**
35+
* @var string
36+
*/
37+
protected string $url = '';
38+
3439
/**
3540
* @var string
3641
*/
@@ -101,6 +106,7 @@ private function fillFromRaw(): void
101106
$this->fillObjectType();
102107
$this->fillProperties();
103108
$this->fillTitle(); // This has to be called after fillProperties(), since title is provided by properties
109+
$this->fillPageUrl();
104110
$this->fillCreatedTime();
105111
$this->fillLastEditedTime();
106112
}
@@ -151,6 +157,16 @@ private function fillTitle(): void
151157
}
152158
}
153159

160+
/**
161+
*
162+
*/
163+
private function fillPageUrl(): void
164+
{
165+
if (Arr::exists($this->responseData, 'url')) {
166+
$this->url = $this->responseData['url'];
167+
}
168+
}
169+
154170
/**
155171
* @param $propertyTitle
156172
* @param $property
@@ -324,6 +340,14 @@ public function getTitle(): string
324340
return $this->title;
325341
}
326342

343+
/**
344+
* @return string
345+
*/
346+
public function getUrl(): string
347+
{
348+
return $this->url;
349+
}
350+
327351
/**
328352
* @return Collection
329353
*/

0 commit comments

Comments
 (0)