public function getById($collection, $documentId, array $options = [])
    {
        if (strpos($documentId, '/') !== false) {
            @list($collection ,$documentId) = explode('/', $documentId);
        }
        $data              = $this->getDocument(Urls::URL_DOCUMENT, $collection, $documentId, $options);
        $options['_isNew'] = false;

        return $this->createFromArrayWithContext($data, $options);
    }
public function getById($collection, $documentId, array $options = [])
    {
        if (strpos($documentId, '/') !== false) {
            @list($collection ,$documentId) = explode('/', $documentId);
        }
        $data              = $this->getDocument(Urls::URL_DOCUMENT, $collection, $documentId, $options);
        $options['_isNew'] = false;

        return $this->createFromArrayWithContext($data, $options);
    }
public function getById ( $ collection , $ documentId , array $ options = [ ] ) { if ( strpos ( $ documentId , '/' ) !== false ) { @ list ( $ collection , $ documentId ) = explode ( '/' , $ documentId ) ; } $ data = $ this -> getDocument ( Urls :: URL_DOCUMENT , $ collection , $ documentId , $ options ) ; $ options [ '_isNew' ] = false ; return $ this -> createFromArrayWithContext ( $ data , $ options ) ; }
Get a single document from a collection

This will throw if the document cannot be fetched from the server.

@throws Exception

@param string $collection  - collection id as a string or number
@param mixed  $documentId  - document identifier
@param array  $options     - optional, array of options
<p>Options are :
<li>'_includeInternals' - true to include the internal attributes. Defaults to false</li>
<li>'_ignoreHiddenAttributes' - true to show hidden attributes. Defaults to false</li>
<li>'ifMatch' - boolean if given revision should match or not</li>
<li>'revision' - The document is returned if it matches/not matches revision.</li>
</p>

@return Document - the document fetched from the server
Get a single document from a collection