DboSource::changeColumn PHP Method

changeColumn() public method

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