Evernote\Client::getNotebook PHP Method

getNotebook() public method

Retrieves a notebook
public getNotebook ( $notebook_guid, null $scope = null ) : Evernote\Model\Notebook | null
$notebook_guid
$scope null
return Evernote\Model\Notebook | null
    public function getNotebook($notebook_guid, $scope = null)
    {
        if (null === $scope || self::PERSONAL_SCOPE === $scope) {
            try {
                $edamNotebook = $this->getUserNotestore()->getNotebook($this->token, $notebook_guid);
                return new Notebook($edamNotebook);
            } catch (EDAMNotFoundException $e) {
                if (self::PERSONAL_SCOPE === $scope) {
                    return null;
                }
            }
        }
        if (null === $scope || self::LINKED_SCOPE === $scope) {
            $linkedNotebooks = $this->listLinkedNotebooks();
            foreach ($linkedNotebooks as $linkedNotebook) {
                try {
                    $sharedNotebook = $this->getNoteBookByLinkedNotebook($linkedNotebook);
                    if ($this->isAppNotebookToken($this->token)) {
                        return $sharedNotebook;
                    }
                } catch (EDAMUserException $e) {
                    // No right on this notebook.
                    continue;
                }
                if ($sharedNotebook->guid === $notebook_guid) {
                    return $sharedNotebook;
                }
            }
            return null;
        }
    }