예제 #1
0
파일: Statement.php 프로젝트: gree/cascade
 /**
  *  コンストラクタ
  *
  *  @param  Cascade_DB_Criteria  データ抽出条件
  */
 public function __construct(Cascade_DB_Criteria $criteria)
 {
     parent::__construct();
     if ($criteria->df_name === NULL) {
         $ex_msg = 'Not found DataFormat Name in Criteria {criteria} %s';
         $ex_msg = sprintf($ex_msg, Cascade_System_Util::export($criteria, TRUE));
         throw new Cascade_Exception_DBException($ex_msg);
     }
     $this->data_format = Cascade::getDataFormat($criteria->df_name);
     $this->criteria = $criteria;
 }
예제 #2
0
파일: Gateway.php 프로젝트: gree/cascade
 /**
  *  インスタンスを生成する
  *
  *  @param   string                 スキーマ名
  *  @return  Cascade_DB_Gateway  インスタンス
  */
 public static function createInstance($schema_name)
 {
     // 基本情報の取得
     $data_format = Cascade::getDataFormat($schema_name);
     $facade = Cascade_Facade_Facade::getInstance($data_format);
     $class_name = Cascade_System_Schema::getGatewayClassName($schema_name);
     // インスタンス作成
     $instance = class_exists($class_name) ? new $class_name($facade, $schema_name) : new Cascade_Proxy_PassThroughGateway($facade, $schema_name);
     if ($instance instanceof Cascade_Proxy_Gateway === FALSE) {
         $ex_msg = 'Invalid a Instance of Gateway {class} %s';
         $ex_msg = sprintf($ex_msg, $class_name);
         throw new Cascade_Exception_Exception($ex_msg);
     }
     // 作成したインスタンスを返す
     return $instance;
 }