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);
}