Beispiel #1
0
 /**
  * データベースのフィールドインスタンスを生成する。
  *
  * @param Vizualizer_Plugin_Table $table フィールドを保有しているテーブルのインスタンス
  * @param string $column フィールドのカラム名
  */
 public function __construct($table, $column)
 {
     if ($table != null) {
         $this->module = $table->getModuleName();
         $this->table = $table->_C;
     }
     if ($column != null) {
         $this->field = $column["Field"];
         $this->type = strpos($column["Type"], "(") > 0 ? substr($column["Type"], 0, strpos($column["Type"], "(")) : $column["Type"];
         $this->canNull = $column["Null"] == "YES" ? true : false;
         $this->isKey = $column["Key"] == "PRI" ? true : false;
         $this->isAutoIncrement = $column["Extra"] == "auto_increment" ? true : false;
     }
 }
Beispiel #2
0
 /**
  * コンストラクタ
  *
  * @param Vizualizer_Plugin_Table $table メインテーブル用オブジェクト
  * @param string $from メインテーブルとは別にテーブル名を指定する場合のテーブル名
  */
 public function __construct($table, $from = null)
 {
     $this->module = $table->getModuleName();
     $this->distinct = false;
     $this->columns = array();
     if ($from === null) {
         $this->tables = $table->_T;
     } else {
         $this->tables = $from;
     }
     $this->wheres = array();
     $this->groups = array();
     $this->having = array();
     $this->orders = array();
     $this->tableValues = array();
     $this->whereValues = array();
     $this->havingValues = array();
     if (isset($table->delete_flg)) {
         $this->wheres[] = $table->delete_flg . " = 0";
     }
 }