public function describe($name, array $options = [])
    {
        $config = $this->_connection->config();
        if (strpos($name, '.')) {
            list($config['schema'], $name) = explode('.', $name);
        }
        $table = new TableSchema($name);

        $this->_reflect('Column', $name, $config, $table);
        if (count($table->columns()) === 0) {
            throw new Exception(sprintf('Cannot describe %s. It has 0 columns.', $name));
        }

        $this->_reflect('Index', $name, $config, $table);
        $this->_reflect('ForeignKey', $name, $config, $table);
        $this->_reflect('Options', $name, $config, $table);

        return $table;
    }
public function describe($name, array $options = [])
    {
        $config = $this->_connection->config();
        if (strpos($name, '.')) {
            list($config['schema'], $name) = explode('.', $name);
        }
        $table = new TableSchema($name);

        $this->_reflect('Column', $name, $config, $table);
        if (count($table->columns()) === 0) {
            throw new Exception(sprintf('Cannot describe %s. It has 0 columns.', $name));
        }

        $this->_reflect('Index', $name, $config, $table);
        $this->_reflect('ForeignKey', $name, $config, $table);
        $this->_reflect('Options', $name, $config, $table);

        return $table;
    }
public function describe ( $ name , array $ options = [ ] ) { $ config = $ this -> _connection -> config ( ) ; if ( strpos ( $ name , '.' ) ) { list ( $ config [ 'schema' ] , $ name ) = explode ( '.' , $ name ) ; } $ table = new TableSchema ( $ name ) ; $ this -> _reflect ( 'Column' , $ name , $ config , $ table ) ; if ( count ( $ table -> columns ( ) ) === 0 ) { throw new Exception ( sprintf ( 'Cannot describe %s. It has 0 columns.' , $ name ) ) ; } $ this -> _reflect ( 'Index' , $ name , $ config , $ table ) ; $ this -> _reflect ( 'ForeignKey' , $ name , $ config , $ table ) ; $ this -> _reflect ( 'Options' , $ name , $ config , $ table ) ; return $ table ; }
Get the column metadata for a table.

Caching will be applied if `cacheMetadata` key is present in the Connection
configuration options. Defaults to _cake_model_ when true.

### Options

- `forceRefresh` - Set to true to force rebuilding the cached metadata.
Defaults to false.

@param string $name The name of the table to describe.
@param array $options The options to use, see above.
@return \Cake\Database\Schema\TableSchema Object with column metadata.
@throws \Cake\Database\Exception when table cannot be described.
Get the column metadata for a table .