src/Keboola/Writer/GoodData/Client.php
public function updateTableColumns($writerId, $tableId, array $columns)
    {
        $allowedConfigurationOptions = ['name', 'title', 'type', 'reference', 'schemaReference', 'format', 'dateDimension'];
        foreach ($columns as $column) {
            if (!isset($column['name'])) {
                throw new ClientException("One of the columns is missing 'name' parameter");
            }
            foreach ($column as $k => $v) {
                if (!in_array($k, $allowedConfigurationOptions)) {
                    throw new ClientException("Option '$k' for column '$column' is not allowed, choose from: " . implode(', ', $allowedConfigurationOptions));
                }
            }
        }

        $params = [
            'writerId' => $writerId,
            'tableId' => $tableId,
            'columns' => $columns
        ];
        return $this->getCommand('UpdateTableColumns', $params)->execute();
    }
public function updateTableColumns($writerId, $tableId, array $columns)
    {
        $allowedConfigurationOptions = ['name', 'title', 'type', 'reference', 'schemaReference', 'format', 'dateDimension'];
        foreach ($columns as $column) {
            if (!isset($column['name'])) {
                throw new ClientException("One of the columns is missing 'name' parameter");
            }
            foreach ($column as $k => $v) {
                if (!in_array($k, $allowedConfigurationOptions)) {
                    throw new ClientException("Option '$k' for column '$column' is not allowed, choose from: " . implode(', ', $allowedConfigurationOptions));
                }
            }
        }

        $params = [
            'writerId' => $writerId,
            'tableId' => $tableId,
            'columns' => $columns
        ];
        return $this->getCommand('UpdateTableColumns', $params)->execute();
    }
public function updateTableColumns ( $ writerId , $ tableId , array $ columns ) { $ allowedConfigurationOptions = [ 'name' , 'title' , 'type' , 'reference' , 'schemaReference' , 'format' , 'dateDimension' ] ; foreach ( $ columns as $ column ) { if ( ! isset ( $ column [ 'name' ] ) ) { throw new ClientException ( "One of the columns is missing 'name' parameter" ) ; } foreach ( $ column as $ k => $ v ) { if ( ! in_array ( $ k , $ allowedConfigurationOptions ) ) { throw new ClientException ( "Option '$k' for column '$column' is not allowed, choose from: " . implode ( ', ' , $ allowedConfigurationOptions ) ) ; } } } $ params = [ 'writerId' => $ writerId , 'tableId' => $ tableId , 'columns' => $ columns ] ; return $ this -> getCommand ( 'UpdateTableColumns' , $ params ) -> execute ( ) ; }
Update table columns configuration
@param $writerId
@param $tableId
@param array $columns Array of arrays with keys: [name, title, type, reference, schemaReference, format, dateDimension]
@throws ClientException
@return mixed
Update table columns configuration