protected function createDbTableFromHeader($header)
    {
        if (empty($this->resource)) {
            $this->resource = 'import_' . time();
        }
        if (!$this->resourceExists('_schema/' . $this->resource)) {
            $schema = $this->createSchemaFromHeader($header);
            $this->createTable($schema);

            return true;
        } else {
            throw new BadRequestException(
                'Importing CSV data into existing DB table [' . $this->resource . '] is not supported.'
            );
        }
    }
protected function createDbTableFromHeader($header)
    {
        if (empty($this->resource)) {
            $this->resource = 'import_' . time();
        }
        if (!$this->resourceExists('_schema/' . $this->resource)) {
            $schema = $this->createSchemaFromHeader($header);
            $this->createTable($schema);

            return true;
        } else {
            throw new BadRequestException(
                'Importing CSV data into existing DB table [' . $this->resource . '] is not supported.'
            );
        }
    }
protected function createDbTableFromHeader ( $ header ) { if ( empty ( $ this -> resource ) ) { $ this -> resource = 'import_' . time ( ) ; } if ( ! $ this -> resourceExists ( '_schema/' . $ this -> resource ) ) { $ schema = $ this -> createSchemaFromHeader ( $ header ) ; $ this -> createTable ( $ schema ) ; return true ; } else { throw new BadRequestException ( 'Importing CSV data into existing DB table [' . $ this -> resource . '] is not supported.' ) ; } }
Creates DB table based on CSV header row

@param $header

@return bool
@throws \DreamFactory\Core\Exceptions\BadRequestException
Creates DB table based on CSV header row