app/src/main/java/com/adroitdevs/belanja/TasksModel.java
Task createDocument(Task task) {
        DocumentRevision rev = new DocumentRevision();
        rev.setBody(DocumentBodyFactory.create(task.asMap()));
        try {
            DocumentRevision created = this.mDatastore.createDocumentFromRevision(rev);
            return Task.fromRevision(created);
        } catch (DocumentException de) {
            return null;
        }
    }
/**
     * Creates a task, assigning an ID.
     *
     * @param task task to create.
     * @return new revision of the document.
     */
Creates a task, assigning an ID.
@param task task to create.
@return new revision of the document.
Creates a task assigning an ID . @param task task to create . @return new revision of the document .
Task createDocument(Task task) {
        DocumentRevision rev = new DocumentRevision();
        rev.setBody(DocumentBodyFactory.create(task.asMap()));
        try {
            DocumentRevision created = this.mDatastore.createDocumentFromRevision(rev);
            return Task.fromRevision(created);
        } catch (DocumentException de) {
            return null;
        }
    }
Task createDocument ( Task task ) { DocumentRevision rev = new DocumentRevision ( ) ; rev . setBody ( DocumentBodyFactory . create ( task . asMap ( ) ) ) ; try { DocumentRevision created = this . mDatastore . createDocumentFromRevision ( rev ) ; return Task . fromRevision ( created ) ; } catch ( DocumentException de ) { return null ; } }
Creates a task, assigning an ID.
Creates a task assigning an ID .