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