1. Easily integrate the PHP drivers to Zend Framework
2. It follows the concept and interfaces that Zend_Db and Zend_Db_Table provides such as:
- Adapter-based connection
- Table Data Gateway pattern
- Row Data Gateway pattern
- Able to inherit and simply call a generic collection client
- Enable the collection class to possibly be just the needed interface that the users need to touch and typically, everything else can be black boxed.
Example:
<?php
require_once("/path/to/Db/Mongodb/Collection/Abstract.php");
class MyCollection extends Db_Mongodb_Collection_Abstract
{
protected $_name = "mycollection";
}
$config["dbname"] = "test";
$config["user"] = "test";
$config["pass"] = "test"
$config["host"] = "localhost";
$config["port"] = "27017";
$model = new MyCollection($config);
//do something with $model
If interested, visit the code google project: zfdbmongodb
No comments:
Post a Comment