public function writeDocument( array $document )
    {
        fwrite( $this->stream, "--" . $this->boundary . "\r\n" );
        if ( isset( $document['_attachments'] ) )
        {
            $this->writeMultipartDocument( $document );
        }
        else
        {
            $this->writeSimpleDocument( $document );
        }
    }
public function writeDocument( array $document )
    {
        fwrite( $this->stream, "--" . $this->boundary . "\r\n" );
        if ( isset( $document['_attachments'] ) )
        {
            $this->writeMultipartDocument( $document );
        }
        else
        {
            $this->writeSimpleDocument( $document );
        }
    }
public function writeDocument ( array $ document ) { fwrite ( $ this -> stream , "--" . $ this -> boundary . "\r\n" ) ; if ( isset ( $ document [ '_attachments' ] ) ) { $ this -> writeMultipartDocument ( $ document ) ; } else { $ this -> writeSimpleDocument ( $ document ) ; } }
Write document to stream

Write a single document to the stream. Can create multipart messages, if
the document contains attachments.

@param array $document
@return void
Write document to stream