/** * Find a single document with the given query and select fields. * * @param string $documentName The document to find. * @param array $query The query criteria. * @param array $select The fields to select * @return object $document */ public function findOne(array $query = array(), array $select = array()) { $result = $this->_collection->findOne($query, $select); if ($result !== null) { return $this->_unitOfWork->getOrCreateDocument($this->_documentName, $result); } return null; }