コード例 #1
0
ファイル: AbstractColumn.php プロジェクト: hschletz/nada
 /**
  * DBMS-specific implementation for setting a column's default value
  **/
 protected function _setDefault()
 {
     if ($this->_default === null) {
         $this->_table->alter(sprintf('ALTER COLUMN %s DROP DEFAULT', $this->_database->prepareIdentifier($this->_name)));
     } else {
         $this->_table->alter(sprintf('ALTER COLUMN %s SET DEFAULT %s', $this->_database->prepareIdentifier($this->_name), $this->_database->prepareValue($this->_default, $this->_datatype)));
     }
 }
コード例 #2
0
ファイル: Mysql.php プロジェクト: hschletz/nada
 /** {@inheritdoc} */
 public function toArray($assoc = false)
 {
     $data = parent::toArray($assoc);
     $data['mysql']['engine'] = $this->getEngine();
     return $data;
 }