コード例 #1
0
ファイル: CL_Mongo.php プロジェクト: stefda/pocketsail
 /**
  * @return CL_Mongo
  */
 public static function get_instance()
 {
     if (self::$instance === NULL) {
         self::$instance = new CL_Mongo();
     }
     return self::$instance;
 }
コード例 #2
0
ファイル: POI2Model.php プロジェクト: stefda/pocketsail
 public function saveToMongo()
 {
     $db = CL_Mongo::getInstance();
     $res = $db->insert('poi', $this->toDoc());
     if (!$res) {
         throw new ActiveRecordException($db->getError());
     }
 }
コード例 #3
0
ファイル: Common.php プロジェクト: stefda/pocketsail
/**
 * @return CL_Mongo
 */
function get_mongo()
{
    return CL_Mongo::get_instance();
}