DboSource::readSchema PHP Method

readSchema() public method

データベースよりスキーマ情報を読み込む
public readSchema ( string $table, $options = [] ) : array
$table string
return array $schema
    public function readSchema($table, $options = array())
    {
        if (is_array($options)) {
            $options = array_merge(array('cache' => true, 'plugin' => null), $options);
            extract($options);
        } else {
            // 後方互換の為
            $cache = $options;
            $plugin = null;
        }
        if ($cache) {
            $this->cacheSources = false;
            ClassRegistry::flush();
        }
        $tables = $this->listSources();
        if (!in_array($this->config['prefix'] . $table, $tables)) {
            return false;
        }
        $CakeSchema = ClassRegistry::init(array(array('class' => 'CakeSchema', 'plugin' => $plugin)));
        $CakeSchema->connection = $this->configKeyName;
        $model = Inflector::classify(Inflector::singularize($table));
        if (!class_exists($model)) {
            $model = false;
        } else {
            $model = array($model);
        }
        return $CakeSchema->read(array('models' => $model));
    }
DboSource