Evernote\Client::findNotes_findInBusinessScopeWithContext PHP Method

findNotes_findInBusinessScopeWithContext() protected method

    protected function findNotes_findInBusinessScopeWithContext($context)
    {
        // Skip the business scope if the user is not a business user, or the scope notebook
        // is not a business notebook, or the business scope is not included.
        if (false === $this->isBusinessUser() || $context->scopeNotebook && !$context->scopeNotebook->isBusinessNotebook() || !$context->scopeNotebook && !$this->isFlagSet($context->scope, self::SEARCH_SCOPE_BUSINESS)) {
            return $this->findNotes_findInLinkedScopeWithContext($context);
        }
        $notesMetadataList = $this->getBusinessNoteStore()->findNotesMetadata($this->getBusinessToken(), $context->noteFilter, 0, $context->maxResults, $context->resultSpec);
        foreach ($notesMetadataList->notes as $notesMetadata) {
            $context->findMetadataResults[] = $notesMetadata;
        }
        // Remember which note guids came from the business. We'll use this later to
        // determine if we're worried about an inability to map back to notebooks.
        $context->resultGuidsFromBusiness = array();
        foreach ($notesMetadataList->notes as $noteMetadata) {
            $context->resultGuidsFromBusiness[] = $noteMetadata->guid;
        }
        return $this->findNotes_findInLinkedScopeWithContext($context);
        //TODO:
        // This is a business user, but apparently has an app notebook restriction that's
        // not in the business. Go look in linked scope.
    }