DboSource::dropColumn PHP Method

dropColumn() public method

カラムを削除する
public dropColumn ( array $options ) : boolean
$options array [ table / field ]
return boolean
    public function dropColumn($options)
    {
        extract($options);
        if (!isset($table) || !isset($field)) {
            return false;
        }
        $old = $this->readSchema($table);
        if (!isset($old['tables'][$table][$field])) {
            return false;
        }
        $new = $old;
        unset($new['tables'][$table][$field]);
        $CakeSchema = ClassRegistry::init('CakeSchema');
        $CakeSchema->connection = $this->configKeyName;
        $compare = $CakeSchema->compare($old, $new);
        $sql = $this->alterSchema($compare);
        return $this->execute($sql);
    }
DboSource