protected function _generateTableColumns($model)
    {
        $model = TableRegistry::get($model);
        $columns = ConnectionManager::get('default')->schemaCollection()->describe($model->table())->columns();

        $result = [];
        $counter = 0;
        $max = 2;

        if (in_array('id', $columns)) {
            $result['id'] = [];
            unset($columns['id']);
        }

        foreach ($columns as $column) {
            if ($counter < $max) {
                $result[$column] = [];
                unset($columns[$column]);
                $counter++;
            }
        }

        if (in_array('created', $columns)) {
            $result['created'] = [];
        }

        return $result;
    }
protected function _generateTableColumns($model)
    {
        $model = TableRegistry::get($model);
        $columns = ConnectionManager::get('default')->schemaCollection()->describe($model->table())->columns();

        $result = [];
        $counter = 0;
        $max = 2;

        if (in_array('id', $columns)) {
            $result['id'] = [];
            unset($columns['id']);
        }

        foreach ($columns as $column) {
            if ($counter < $max) {
                $result[$column] = [];
                unset($columns[$column]);
                $counter++;
            }
        }

        if (in_array('created', $columns)) {
            $result['created'] = [];
        }

        return $result;
    }
protected function _generateTableColumns ( $ model ) { $ model = TableRegistry :: get ( $ model ) ; $ columns = ConnectionManager :: get ( 'default' ) -> schemaCollection ( ) -> describe ( $ model -> table ( ) ) -> columns ( ) ; $ result = [ ] ; $ counter = 0 ; $ max = 2 ; if ( in_array ( 'id' , $ columns ) ) { $ result [ 'id' ] = [ ] ; unset ( $ columns [ 'id' ] ) ; } foreach ( $ columns as $ column ) { if ( $ counter < $ max ) { $ result [ $ column ] = [ ] ; unset ( $ columns [ $ column ] ) ; $ counter ++ ; } } if ( in_array ( 'created' , $ columns ) ) { $ result [ 'created' ] = [ ] ; } return $ result ; }
If no tablecolumns are given, this method will be called to generate a list of tablecolumns.

@param \Cake\ORM\Table $model Model to rely on.
@return array
If no tablecolumns are given this method will be called to generate a list of tablecolumns .