Get a list of all documents from all document sets for the owner page

@return ArrayList
160166
public function getAllDocuments()
    {
        $documents = ArrayList::create();

        foreach ($this->owner->DocumentSets() as $documentSet) {
            /** @var DocumentSet $documentSet */
            $documents->merge($documentSet->getDocuments());
        }
        $documents->removeDuplicates();

        return $documents;
    }
645942
public function getList(): array {
        $list = array();
        $dir = $this->_docRoot . $this->_path;
        if (is_dir($dir)) {
            if ($dh = opendir($dir)) {
                while (($file = readdir($dh)) !== false) {
                    if (substr($file, 0, 1) !== '.'
                        && strpos($file, '.') !== false
                    ) {
                        $list[] = $file;
                    }
                }
                closedir($dh);
            }
        } else {
            throw new Exception($dir . ' is not a directory.');
        }

        return $list;
    }
178839
public function getAncestors() {
        $ancestors=new ArrayList();
        $object   =$this->owner;
        
        while($object=$object->Language()) {
            $ancestors->push($object);
        }
        
        return $ancestors;
    }
540770
public function toArray()
        {
            return array_merge(
                $this->getCustomProperties(),
                array(
                    'label'             => $this->getlabel(),
                    'fragment'          => $this->getFragment(),
                    'id'                => $this->getId(),
                    'class'             => $this->getClass(),
                    'title'             => $this->getTitle(),
                    'target'            => $this->getTarget(),
                    'accesskey'         => $this->getAccesskey(),
                    'rel'               => $this->getRel(),
                    'rev'               => $this->getRev(),
                    'customHtmlAttribs' => $this->getCustomHtmlAttribs(),
                    'order'             => $this->getOrder(),
                    'resource'          => $this->getResource(),
                    'privilege'         => $this->getPrivilege(),
                    'active'            => $this->isActive(),
                    'visible'           => $this->isVisible(),
                    'type'              => get_class($this),
                    'pages'             => parent::toArray()
                )
            );
        }
1138973
public function all() {
        $size = $this->maxPageSize();

        $firstPageResponse = $this->request( $this->createPaginatedRequestQuery( 0, $size ) );
        $header_values = $firstPageResponse->getResponse()->getHeader('X-Result-Total');
        $total = array_shift($header_values);

        $result = $firstPageResponse->json();

        if( $total <= $size ) {
            return $result;
        }

        $requests = [];
        for( $page = 1; $page < ceil( $total / $size ); $page++ ) {
            $requests[] = $this->createPaginatedRequestQuery( $page, $size );
        }

        $responses = $this->requestMany( $requests );

        foreach( $responses as $response ) {
            $result = array_merge( $result, $response->json() );
        }

        return $result;
    }
1156795
public function getDocuments()
    {
        $documents = [];
        foreach ($this->_results as $doc) {
            $documents[] = $doc->getDocument();
        }

        return $documents;
    }
952484
public function toArray()
    {
        $document = [];

        if (! empty($this->links)) {
            $document['links'] = $this->links;
        }

        if (! empty($this->data)) {
            $document['data'] = $this->data->toArray();

            $resources = $this->getIncluded($this->data);

            if (count($resources)) {
                $document['included'] = array_map(function (Resource $resource) {
                    return $resource->toArray();
                }, $resources);
            }
        }

        if (! empty($this->meta)) {
            $document['meta'] = $this->meta;
        }

        if (! empty($this->errors)) {
            $document['errors'] = $this->errors;
        }

        if (! empty($this->jsonapi)) {
            $document['jsonapi'] = $this->jsonapi;
        }

        return $document;
    }
844645
public function getLinks(): ?DocumentLinks
    {
        return DocumentLinks::createWithoutBaseUri()
            ->setPagination("/users", $this->object, $this->request->getUri()->getQuery());
    }
391138
public static function getRootPageList()
    {
        static $cache = null;

        if ($cache === null) {
            $query = 'SELECT uid,
                             pid,
                             title
                        FROM pages
                       WHERE is_siteroot = 1
                         AND deleted = 0';
            $cache = DatabaseUtility::getAllWithIndex($query, 'uid');
        }

        return $cache;
    }
828669
public function fetchAll()
	{
		if ($this->result === null) {
			$this->query();
		}
		$machine = $this->machine;

		$id_keys = $this->machine->describeId();

		if (count($id_keys) == 1) {
			$list = array();
			while(($properties = $this->result->fetch(\PDO::FETCH_ASSOC))) {
				$item = $machine->hotRef($machine->decodeProperties($properties));
				$list[$item->id] = $item;
			}
			return $list;
		} else {
			return array_map(function($properties) use ($machine) {
					return $machine->hotRef($machine->decodeProperties($properties));
				}, $this->result->fetchAll(\PDO::FETCH_ASSOC));
		}
	}
1166498
public function getCurrentDocumentSet()
    {
        if ($id = $this->getRequest()->getVar('dsid')) {
            return DMSDocumentSet::get()->byId($id);
        }
        return singleton('DMSDocumentSet');
    }
152063
public function getAll()
    {
        $all   = [];
        $pages = $this->getPages();

        if ($this->getFirst() !== null) {
            $all[$this->getFirst()] = Pagination::FIRST;
        }

        if ($this->getLess() !== null) {
            $all[$this->getLess()] = Pagination::LESS;
        }

        foreach ($pages as $k => $page) {
            $all[$k] = $page;
        }

        if ($this->getMore() !== null) {
            $all[$this->getMore()] = Pagination::MORE;
        }

        if ($this->getLast() !== null) {
            $all[$this->getLast()] = Pagination::LAST;
        }

        ksort($all);

        return $all;
    }
33930
public function getResults()
	{
		if (!isset($this->resultset))
		{
			$this->run();
		}

		$documents = array();
		foreach ($this->resultset as $document)
		{
			array_push($documents, $document);
		}

		foreach ($documents as &$document)
		{
			$document = $document->getFields();
		}

		return $documents;
	}
933155
public function indexPage()
    {
        $pageIndexed = false;
        $documents = []; // this will become useful as soon as when starting to index individual records instead of whole pages

        if (is_null($this->solrConnection)) {
            // intended early return as it doesn't make sense to continue
            // and waste processing time if the solr server isn't available
            // anyways
            // FIXME use an exception
            return $pageIndexed;
        }

        $pageDocument = $this->getPageDocument();
        $pageDocument = $this->substitutePageDocument($pageDocument);

        $this->applyIndexPagePostProcessors($pageDocument);

        self::$pageSolrDocument = $pageDocument;
        $documents[] = $pageDocument;
        $documents = $this->getAdditionalDocuments($pageDocument, $documents);
        $this->processDocuments($documents);

        $pageIndexed = $this->addDocumentsToSolrIndex($documents);
        $this->documentsSentToSolr = $documents;

        return $pageIndexed;
    }
1220583
public function getIndices(): array
    {
        $appId = $this->getAppKey();

        $result = [];
        foreach ($this->indices as $index => $_) {
            if (false !== preg_match("/(?P<app_id>[^_]+)\_(?P<id>[\S]+)/", $index, $matches)) {
                if (!empty($appId) && $matches['app_id'] !== $appId) {
                    continue;
                }

                $indexMeta = [
                    'uuid' => ['id' => $matches['id']],
                    'app_id' => ['id' => $matches['app_id']],
                    'doc_count' => 0,
                ];

                $result[] = Index::createFromArray($indexMeta);
            }
        }

        return $result;
    }
315682
public function getAll()
    {
        if (isset($this->collection[$this->id])) {
            return $this->collection[$this->id];
        }

        return array();
    }
559634
public function all()
    {
        $result = [];
        foreach ($this->collection->find() as $document) {
            $result[] = [
                'program' => $document['program'],
                'process' => $document['process'],
            ];
        }
        return $result;
    }