Doctrine\ODM\MongoDB\Persisters\DocumentPersister::createDocument PHP Метод

createDocument() приватный Метод

Creates or fills a single document object from an query result.
private createDocument ( $result, object $document = null, array $hints = [] ) : object
$result The query result.
$document object The document object to fill, if any.
$hints array Hints for document creation.
Результат object The filled and managed document object or NULL, if the query result is empty.
    private function createDocument($result, $document = null, array $hints = array())
    {
        if ($result === null) {
            return null;
        }

        if ($document !== null) {
            $hints[Builder::HINT_REFRESH] = true;
            $id = $result['_id'];
            $this->uow->registerManaged($document, $id, $result);
        }

        return $this->uow->getOrCreateDocument($this->class->name, $result, $hints);
    }