signedRequest) { return; } $this->pageData = $this->signedRequest->get('page'); } /** * Returns a value from the page data. * * @param string $key * @param mixed|null $default * * @return mixed|null */ public function getPageData($key, $default = null) { if (isset($this->pageData[$key])) { return $this->pageData[$key]; } return $default; } /** * Returns true if the user is an admin. * * @return boolean */ public function isAdmin() { return $this->getPageData('admin') === true; } /** * Returns the page id if available. * * @return string|null */ public function getPageId() { return $this->getPageData('id'); } }