示例#1
0
 /**
  * Gets the current collection
  * 
  * @return MongoCollection
  */
 public function getCollection()
 {
     if (is_null($this->collection)) {
         $cnx = new Connector($this->config);
         $this->collection = $cnx->getCollection();
     }
     return $this->collection;
 }
示例#2
0
 protected function setUp()
 {
     $cnx = new Connector(array('server' => 'localhost', 'database' => 'phpunit', 'collection' => 'zero'));
     $this->collection = $cnx->getCollection();
     $this->repository = new Repository($this->collection, new Transformer(new MongoKeyFactory()));
 }