TODO: Refactor this away.

@return DocumentAccessor
483844
public function getAccessor()
    {
        if ($this->accessor) {
            return $this->accessor;
        }

        $this->accessor = new DocumentAccessor($this->getDocument());

        return $this->accessor;
    }
418808
public function docblockify()
    {
        foreach( $this->lines as &$line ) {
            $line = ' * ' . $line;
        }
        array_unshift( $this->lines, '/**' );
        array_push( $this->lines, ' */');
        return $this;
    }
1318967
public function parent()
    {
        $p = $this->_parent();
        return $p ? new self($this->doc, $p) : null;
    }
1156833
public function disDocumentFiles()
    {
        $properties     = $this->getProperties();
        $acceptedFiles  = $properties['acceptedFiles'];
        $docsExt        = $this->getDocumentExtensionConstant();
        $acceptedFiles  = $this->rmAcceptedFiles($acceptedFiles, $docsExt);
        $properties['acceptedFiles']    = $acceptedFiles;
        $this->setProperties($properties);
        return $this;
    }
529990
protected function proxy() {
        if (!$this->context) {
            $this->context = new DocumentContext(
                $this->version,
                $this->solution['serviceSid'],
                $this->solution['sid']
            );
        }

        return $this->context;
    }
1109304
protected function parseDocument()
    {
        $start = $this->token->getStart();
        $definitions = [];

        do {
            if ($this->peek(Token::BRACE_L_TYPE)) {
                $definitions[] = $this->parseOperationDefinition();
            } else if ($this->peek(Token::NAME_TYPE)) {
                $value = $this->token->getValue();
                if ($value === 'query' || $value === 'mutation') {
                    $definitions[] = $this->parseOperationDefinition();
                } else if ($value === 'fragment') {
                    $definitions[] = $this->parseFragmentDefinition();
                } else {
                    throw $this->unexpected();
                }
            } else {
                throw $this->unexpected();
            }
        } while (!$this->skip(Token::EOF_TYPE));

        return new Document($definitions, $this->location($start));
    }
496845
public function getIterator()
    {
        $this->kernel->boot();
        $viewDirectories = $this->getPossibleViewDirectories();
        $viewDirectories = $this->removeNotExistingDirectories($viewDirectories);
        $templates       = $this->getTwigTemplatesIn($viewDirectories);
        return new \ArrayIterator($templates);
    }
1270646
public function getIterator()
    {
        $isTraversal = (is_array($this->body) || $this->body instanceof \Traversable);

        return $isTraversal ? new \ArrayIterator($this->body) : new \ArrayIterator([]);
    }
285868
public function doCancel()
    {
        if ($this->isCancelable()) {
            $this->status = self::STATUS_CANCELED;

            $this->save();
        }

        return $this;
    }
622009
protected function getAccess()
    {
        $access = array_merge([
            'acl' => 'MASTER',
            'export' => 'EXPORT',
            'historyCompareRevisions' => 'EDIT',
            'historyViewRevision' => 'EDIT',
            'history' => 'EDIT',
            'edit' => 'EDIT',
            'show' => 'VIEW',
            'create' => 'CREATE',
            'delete' => 'DELETE',
            'batchDelete' => 'DELETE',
            'list' => 'LIST',
        ], $this->getAccessMapping());

        foreach ($this->extensions as $extension) {
            // TODO: remove method check in next major release
            if (method_exists($extension, 'getAccessMapping')) {
                $access = array_merge($access, $extension->getAccessMapping($this));
            }
        }

        return $access;
    }
1099121
public function getIterator()
    {
        $iterator   = parent::getIterator();
        $content    = $this->getDependentContent();

        if ( $content )
        {
            $iterator->append( new ArrayIterator( array(
                'rootTitle' => $content->title,
            ) ) );
        }

        return $iterator;
    }
439027
public function getIterator(): \Iterator
    {
        $hydrator = $this->documentManager->newHydrator($this->hydrationMode);
        $query = clone $this->query;

        if (! $query->hasParam('_source')) {
            /** @var DocumentMetadata $class */
            $class = $this->documentManager->getClassMetadata($this->documentClass);
            $query->setSource($class->eagerFieldNames);
        }

        if (null !== $this->sort) {
            $query->setSort($this->sort);
        }

        if (null !== $this->limit) {
            $query->setSize($this->limit);
        }

        if (null !== $this->offset) {
            $query->setFrom($this->offset);
        }

        $generator = null !== $this->cacheProfile ? $this->_doExecuteCached($query) : $this->_doExecute($query);
        foreach ($generator as $resultSet) {
            yield from $hydrator->hydrateAll($resultSet, $this->documentClass);
        }
    }
870638
public function getIterator()
    {
        $entries = array_slice($this->getResults(), $this->getCurrentOffset(), $this->getPerPage(), true);

        return new ArrayIterator($entries);
    }
43225
public function getIterator()
    {
        // Return an iterator just like the old iteration of the HistoryPlugin for BC compatibility (use getAll())
        return new \ArrayIterator(array_map(function ($entry) {
            $entry['request']->getParams()->set('actual_response', $entry['response']);
            return $entry['request'];
        }, $this->transactions));
    }
772942
public function writer()
    {
        $writer = new ObjectWriter($this->objectFactory);

        $storage = $this;
        $writer->setObjectHandler(function ($object) use ($storage) {
            $storage->attach($object);
        });

        return $writer;
    }
19736
protected function getIterator()
    {
        if ($this->iterator === null && $this->isExists()) {
            $dirIterator = new DirectoryIterator($this->getPathname());
            $this->iterator = new CallbackFilterIterator($dirIterator, function ($current, $key, $iterator) {
                return !$iterator->isDot();
            });
        }

        return $this->iterator;
    }
6279
public function current()
    {
        $document = $this->getCursor()->current();

        if ($document instanceof ActiveRecord) {
            $documentToArray = $document->toArray();
            $this->entitySchema = $document->getSchema();
        } else {
            $documentToArray = (array) $document;
        }

        return $this->getAssembler()->assemble(
            $documentToArray,
            $this->entitySchema
        );
    }