DboSource::createTable PHP Method

createTable() public method

テーブルを作成する
public createTable ( array $options ) : boolean
$options array [ schema / table ]
return boolean
    public function createTable($options)
    {
        extract($options);
        if (!isset($schema)) {
            return false;
        }
        if (is_array($schema)) {
            if (empty($table)) {
                return false;
            }
            $name = Inflector::pluralize(Inflector::classify($table));
            $options = array('name' => $name, 'connection' => $this->configKeyName, $table => $schema);
            $schema = new CakeSchema($options);
        }
        // SQLを生成して実行
        $sql = $this->createSchema($schema);
        if ($return = $this->execute($sql)) {
            if (method_exists($schema, 'after')) {
                $schema->after(['create' => strtolower($schema->name), 'errors' => null]);
            }
        }
        // とりあえずキャッシュを全て削除
        clearCache(null, 'models');
        return $return;
    }
DboSource