示例#1
0
 public function getReference()
 {
     $collection = collection::forClass($this->_className)->select();
     if (null != $this->_model) {
         $this->_model->save();
     }
     $id = $this->getId();
     return \MongoDBRef::create($collection->getName(), $id, (string) $collection->db);
 }
示例#2
0
 public function makeRef()
 {
     $className = \get_called_class();
     //$ref = \MongoDBRef::create($this->collectionName(), $this->getId(), $this->dbName());
     return collection::forClass($className)->select()->createDBRef($this->_data);
     //->createReference($this->getId());
 }