Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/Entities/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ class Page extends Entity
*/
protected string $title = '';

/**
* @var string
*/
protected string $url = '';

/**
* @var string
*/
Expand Down Expand Up @@ -101,6 +106,7 @@ private function fillFromRaw(): void
$this->fillObjectType();
$this->fillProperties();
$this->fillTitle(); // This has to be called after fillProperties(), since title is provided by properties
$this->fillPageUrl();
$this->fillCreatedTime();
$this->fillLastEditedTime();
}
Expand Down Expand Up @@ -151,6 +157,16 @@ private function fillTitle(): void
}
}

/**
*
*/
private function fillPageUrl(): void
{
if (Arr::exists($this->responseData, 'url')) {
$this->url = $this->responseData['url'];
Copy link
Member

@mechelon mechelon Jul 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename to pageUrl? because this is not a property 🤔

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅😊 done

}
}

/**
* @param $propertyTitle
* @param $property
Expand Down Expand Up @@ -324,6 +340,14 @@ public function getTitle(): string
return $this->title;
}

/**
* @return string
*/
public function getUrl(): string
{
return $this->url;
}

/**
* @return Collection
*/
Expand Down