PHP code example of wcatron / mongo-db-framework

1. Go to this page and download the library: Download wcatron/mongo-db-framework library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wcatron / mongo-db-framework example snippets


class YourClass extend Document {

	const COLLECTION = 'YourCollection';

	function toDocument() {
		$document = parent::toDocument();
		// Your code setting the documents key/value pairs.
		return $document;
	}

	function fromDocument($document) {
		parent::fromDocument($document);
		// Your code setting the objects properties.
	}
}