public function updateTables($tables, $allow_delete_fields = false, $return_schema = false)
    {
        $tables = static::validateAsArray($tables, null, true, 'There are no table sets in the request.');

        foreach ($tables as $table) {
            $name = (is_array($table)) ? array_get($table, 'name') : $table;
            if (empty($name)) {
                throw new BadRequestException("Table schema received does not have a valid name.");
            }
            if ($this->doesTableExist($name)) {
                $this->validateSchemaAccess($name, Verbs::PATCH);
            } else {
                $this->validateSchemaAccess(null, Verbs::POST);
            }
        }

        $result = $this->updateSchema($tables, true, $allow_delete_fields);

        //  Any changes here should refresh cached schema
        $this->refreshCachedTables();

        if ($return_schema) {
            return $this->describeTables($tables);
        }

        return $result;
    }
public function updateTables($tables, $allow_delete_fields = false, $return_schema = false)
    {
        $tables = static::validateAsArray($tables, null, true, 'There are no table sets in the request.');

        foreach ($tables as $table) {
            $name = (is_array($table)) ? array_get($table, 'name') : $table;
            if (empty($name)) {
                throw new BadRequestException("Table schema received does not have a valid name.");
            }
            if ($this->doesTableExist($name)) {
                $this->validateSchemaAccess($name, Verbs::PATCH);
            } else {
                $this->validateSchemaAccess(null, Verbs::POST);
            }
        }

        $result = $this->updateSchema($tables, true, $allow_delete_fields);

        //  Any changes here should refresh cached schema
        $this->refreshCachedTables();

        if ($return_schema) {
            return $this->describeTables($tables);
        }

        return $result;
    }
public function updateTables ( $ tables , $ allow_delete_fields = false , $ return_schema = false ) { $ tables = static :: validateAsArray ( $ tables , null , true , 'There are no table sets in the request.' ) ; foreach ( $ tables as $ table ) { $ name = ( is_array ( $ table ) ) ? array_get ( $ table , 'name' ) : $ table ; if ( empty ( $ name ) ) { throw new BadRequestException ( "Table schema received does not have a valid name." ) ; } if ( $ this -> doesTableExist ( $ name ) ) { $ this -> validateSchemaAccess ( $ name , Verbs :: PATCH ) ; } else { $ this -> validateSchemaAccess ( null , Verbs :: POST ) ; } } $ result = $ this -> updateSchema ( $ tables , true , $ allow_delete_fields ) ; //  Any changes here should refresh cached schema $ this -> refreshCachedTables ( ) ; if ( $ return_schema ) { return $ this -> describeTables ( $ tables ) ; } return $ result ; }
Update one or more tables by array of table properties

@param array $tables
@param bool  $allow_delete_fields
@param bool  $return_schema Return a refreshed copy of the schema from the database
@return array
@throws BadRequestException
@throws \DreamFactory\Core\Exceptions\ForbiddenException
@throws \Exception
Update one or more tables by array of table properties