DOCUMENT ME!

@return DOCUMENT ME!
@throws CpoException DOCUMENT ME!
8296
@Override
  protected Connection getWriteConnection() throws CpoException {
    Connection connection = getStaticConnection();

    setConnectionBusy(connection);

    return connection;
  }
909047
public Document getResultDocument() throws TransformerException {
        return withExceptionHandling(new Trans<Document>() {
                public Document transform() {
                    return transformation.transformToDocument();
                }
            });
    }
111094
public I_CmsSearchDocument getDocument(int docId) {

        try {
            IndexSearcher searcher = getSearcher();
            return new CmsLuceneDocument(searcher.doc(docId));
        } catch (IOException e) {
            // ignore, return null and assume document was not found
        }
        return null;
    }
382142
public function withoutDocComment() : self {
      $this->docCommentChecker = function (Token $token) {
        return $token->isValid() === false;
      };

      return $this;
    }
197248
public function getInstanceDocumentAsMemoryFile()
	{
		// If this returns null there is no instance document
		$xbrl = $this->getInstanceDocument( false );
		if ( ! $xbrl ) return false;

		$instanceFilename = "mem://{$this->instanceDocument}";

		if ( ! class_exists("MemoryStream", true ) )
		{
			/**
			 * Load the dictionary class
			 */
			$utiltiesPath = isset( $_ENV['UTILITY_LIBRARY_PATH'] )
				? $_ENV['UTILITY_LIBRARY_PATH']
				: ( defined( 'UTILITY_LIBRARY_PATH' ) ? UTILITY_LIBRARY_PATH : __DIR__ . "/../utilities" );
			require_once "$utiltiesPath/MemoryStream.php";
		}

		$f = fopen( $instanceFilename, "w+" );
		fwrite( $f, $xbrl );
		fclose( $f );

		return $instanceFilename;
	}
1306577
public function getDocument()
    {
        if ($this->node->ownerDocument === null) {
            return null;
        }

        return new Document($this->node->ownerDocument);
    }
1237771
public function getAsObj()
    {
        $this->format(Format::get('xml'));

        $this->run();

        return (new MyReport(simplexml_load_string($this->data->getAsString())));
    }
717397
@InterfaceAudience.Public
    public Document getDocument() {
        if (getDocumentId() == null) {
            return null;
        }
        assert (database != null);
        Document document = database.getDocument(getDocumentId());
        document.loadCurrentRevisionFrom(this);
        return document;
    }
248721
public function documentAST(): DocumentAST
    {
        if (empty($this->documentAST)) {
            $this->documentAST = config('lighthouse.cache.enable')
                ? app('cache')
                    ->rememberForever(
                        config('lighthouse.cache.key'),
                        function (): DocumentAST {
                            return $this->buildAST();
                        }
                    )
                : $this->buildAST();
        }

        return $this->documentAST;
    }
370799
private Document getProjectionDocument() {
		if ( projections.isEmpty() ) {
			return null;
		}

		Document projectionDocument = new Document();

		for ( String projection : projections ) {
			projectionDocument.put( projection, 1 );
		}

		return projectionDocument;
	}
17533
public function getTipoDocumento()
    {
        $cpf_cnpj_cei = Util::onlyNumbers($this->documento);

        if (strlen($cpf_cnpj_cei) == 11) {
            return 'CPF';
        } elseif (strlen($cpf_cnpj_cei) == 10) {
            return 'CEI';
        }
        
        return 'CNPJ';
    }
36541
public static OClass getCommonOClass(Iterator<ODocument> it) {
    	Set<OClass> candidates =  null;
    	OClass ret = null;
    	while(it.hasNext() && (candidates==null || !candidates.isEmpty())) {
    		ODocument doc = it.next();
    		OClass thisOClass = doc.getSchemaClass();
    		if(candidates==null){
    			candidates = new HashSet<OClass>();
    			candidates.add(thisOClass);
    			candidates.addAll(thisOClass.getAllSuperClasses());
    			ret = thisOClass;
    		}
    		else {
    			if(ret!=null && (ret.equals(thisOClass) || ret.isSuperClassOf(thisOClass))) continue;
    			else if(ret!=null && thisOClass.isSuperClassOf(ret)) {
    				ret = thisOClass;
    				candidates.clear();
    				candidates.add(ret);
    				candidates.addAll(ret.getAllSuperClasses());
    			}
    			else {
    				ret = null;
    				candidates.retainAll(thisOClass.getAllSuperClasses());
    			}
    		}
    	}
    	
    	if(ret==null && candidates!=null && !candidates.isEmpty()) {
    		ret = getDeepestOClass(candidates);
    	}
    	
    	return ret;
    }
75900
private synchronized Document asXmlDocument() throws IOException {
    Document doc;
    try {
      doc =
        DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
    } catch (ParserConfigurationException pe) {
      throw new IOException(pe);
    }
    Element conf = doc.createElement("configuration");
    doc.appendChild(conf);
    conf.appendChild(doc.createTextNode("\n"));
    handleDeprecation(); //ensure properties is set and deprecation is handled
    for (Enumeration<Object> e = properties.keys(); e.hasMoreElements();) {
      String name = (String)e.nextElement();
      Object object = properties.get(name);
      String value = null;
      if (object instanceof String) {
        value = (String) object;
      }else {
        continue;
      }
      Element propNode = doc.createElement("property");
      conf.appendChild(propNode);

      Element nameNode = doc.createElement("name");
      nameNode.appendChild(doc.createTextNode(name));
      propNode.appendChild(nameNode);

      Element valueNode = doc.createElement("value");
      valueNode.appendChild(doc.createTextNode(value));
      propNode.appendChild(valueNode);

      if (updatingResource != null) {
        String[] sources = updatingResource.get(name);
        if(sources != null) {
          for(String s : sources) {
            Element sourceNode = doc.createElement("source");
            sourceNode.appendChild(doc.createTextNode(s));
            propNode.appendChild(sourceNode);
          }
        }
      }

      conf.appendChild(doc.createTextNode("\n"));
    }
    return doc;
  }
1349532
private Document getDocument() {
    Document document = new Document();
    Comment comment = new Comment(" generated on " + new Date() + " ");
    document.addContent(comment);

    Element rootElement = new Element(ROOT_ELEMENT_NAME);
    rootElement.setAttribute(MASTER_LANGUAGE_ATTRIBUTE_NAME, getMasterLanguage());
    for (Attribute attribute : additionalRootAttrs) {
      // need to set the attribute like a new attribute,
      // as the original one stored the parent element and cannot be set to a new parent
      rootElement.setAttribute(attribute.getName(), attribute.getValue(), attribute.getNamespace());
    }
    // set the namespace, this makes sure that it is written into the trema node
    for (Namespace namespace : additionalNamespaces) {
      rootElement.addNamespaceDeclaration(namespace);
    }

    for (ITextNode textNode : textNodeList) {
      String key = textNode.getKey();
      Element textElement = new Element(TEXT_ELEMENT_NAME);
      textElement.setAttribute(KEY_ATTRIBUTE_NAME, key);

      String context = textNode.getContext();
      Element contextElement = new Element(CONTEXT_ELEMENT_NAME);
      contextElement.setText(context);
      textElement.addContent(contextElement);

      IValueNode[] valueNodes = textNode.getValueNodes();
      for (IValueNode valueNode : valueNodes) {
        Element valueElement = new Element(VALUE_ELEMENT_NAME);
        valueElement.setAttribute(LANGUAGE_ATTRIBUTE_NAME, valueNode.getLanguage());
        valueElement.setAttribute(STATUS_ATTRIBUTE_NAME, valueNode.getStatus().getName());
        valueElement.setText(valueNode.getValue());
        textElement.addContent(valueElement);
      }
      rootElement.addContent(textElement);
    }
    document.setRootElement(rootElement);
    return document;
  }
102787
public function getDocComment(): ?Doc
    {
        $docComment = $this->classConstants->consts[$this->index]->getDocComment();
        if ($docComment === null) {
            $docComment = $this->classConstants->getDocComment();
        }

        return $docComment;
    }
1152180
public function getDocument()
    {
        if (!$this->_document instanceof Zend_Search_Lucene_Document) {
            $this->_document = $this->_index->getDocument($this->id);
        }

        return $this->_document;
    }
176214
@Override
  public BsonDocument toBsonDocument() {
    final BsonDocument asDoc = new BsonDocument();
    asDoc.put(Fields.ID_FIELD, id);

    asDoc.put(Fields.OPERATION_TYPE_FIELD, new BsonString(getOperationType().toRemote()));

    final BsonDocument nsDoc = new BsonDocument();
    nsDoc.put(Fields.NS_DB_FIELD, new BsonString(ns.getDatabaseName()));
    nsDoc.put(Fields.NS_COLL_FIELD, new BsonString(getNamespace().getCollectionName()));
    asDoc.put(Fields.NS_FIELD, nsDoc);

    asDoc.put(Fields.DOCUMENT_KEY_FIELD, getDocumentKey());

    if (getFullDocument() != null && (getFullDocument() instanceof BsonValue)
        && ((BsonValue) getFullDocument()).isDocument()) {
      asDoc.put(Fields.FULL_DOCUMENT_FIELD, (BsonValue) getFullDocument());
    }

    if (getUpdateDescription() != null) {
      asDoc.put(Fields.UPDATE_DESCRIPTION_FIELD, getUpdateDescription().toBsonDocument());
    }

    asDoc.put(Fields.WRITE_PENDING_FIELD, new BsonBoolean(hasUncommittedWrites()));
    return asDoc;
  }