示例#1
0
 /**
  * @return CL_Mongo
  */
 public static function get_instance()
 {
     if (self::$instance === NULL) {
         self::$instance = new CL_Mongo();
     }
     return self::$instance;
 }
示例#2
0
 public function saveToMongo()
 {
     $db = CL_Mongo::getInstance();
     $res = $db->insert('poi', $this->toDoc());
     if (!$res) {
         throw new ActiveRecordException($db->getError());
     }
 }
示例#3
0
/**
 * @return CL_Mongo
 */
function get_mongo()
{
    return CL_Mongo::get_instance();
}