Return string for dropping all columns

@param array $fields
@return array
185604
protected function dropColumns(array $fields)
    {
        $schema = [];

        foreach($fields as $field)
        {
            $schema[] = $this->dropColumn($field);
        }

        return $schema;
    }
570283
private function convertColumnsToRawFields(array $columns) {
        $columnMaps = $this->getModelsMetaData()->getColumnMap($this);
        foreach($columns as $key => $value) {
            if(!array_key_exists($value, $columnMaps)) {
                //Look up in the changed values
                $index = array_search($value, $columnMaps);
                if($index === false) {
                    throw new \InvalidArgumentException('Invalid Column, could not find: ' . $value);
                } else {
                    $columns[$key] = $index;
                }
            }
        }
        return $columns;
    }
51326
protected function formatFieldList($fields) {
		if( !is_array($fields) ) {
			return $fields;
		}
		$string	= '';
		foreach( $fields as $key => $value ) {
			$string .= ($string ? ', ' : '').$this->escapeIdentifier($key).'='.$this->formatValue($value);
		}
		return $string;
	}
241477
protected function _getFieldsFromConfig($fields = null) {
		$result = [];
		if (empty($fields)) {
			return $result;
		}

		if (!is_array($fields)) {
			$result = [$fields];
		} else {
			$result = array_keys($fields);
		}

		return $result;
	}
359024
protected function upsertDeletedAt(array $fields)
    {
        foreach ($fields as $field) {
            if ($field->isAutoManagedOnDelete()) {
                return $fields;
            }
        }

        $fields[] = $this->getNewDeletedAtField();

        return $fields;
    }
1343193
public static function drop($subjects, $fields)
	{
		$up = <<<UP
		\DBUtil::drop_table('{$subjects[1]}');
UP;
		$field_str = '';
		$column_list = \DB::list_columns($subjects[1]);

		foreach ($column_list as $column)
		{
			switch ($column['type'])
			{
				case 'float':
					$constraint = '\''.$column['numeric_precision'].', '.$column['numeric_scale'].'\'';
				break;
				case 'int':
					$constraint = $column['display'];
				break;
				case 'string':
					switch ($column['data_type'])
					{
						case 'binary':
						case 'varbinary':
						case 'char':
						case 'varchar':
							$constraint = $column['character_maximum_length'];
						break;

						case 'enum':
						case 'set':
							$constraint = '"\''.implode('\',\'',$column['options']).'\'"';
						break;
					}
				break;
			}

			$constraint_str = isset($constraint) ? ", 'constraint' => $constraint" : '';
			$auto_increment = $column['extra'] == 'auto_increment' ? ", 'auto_increment' => true" : '';
			$default_str = $column['default'] != null ? ", 'default' => '{$column['default']}'" : ", 'null' => true";

			if ($column['key'] == 'PRI')
			{
			  $primary_keys[] = "'{$column['name']}'";
			}
			else if ($column['key'] == 'MUL')
			{
			  $indexes[] = $column['name'];
			}

			$field_str .= "\t\t\t'{$column['name']}' => array('type' => '{$column['data_type']}'{$default_str}{$constraint_str}{$auto_increment}),".PHP_EOL;
			unset($constraint);
		}

		$primary_keys = implode(',', $primary_keys);
		$down = <<<DOWN
		\DBUtil::create_table('{$subjects[1]}', array(
$field_str
		), array($primary_keys));
DOWN;
		$down .= PHP_EOL;

		$active_db = \Config::get('db.active');
		$table_prefix = \Config::get('db.'.$active_db.'.table_prefix');

		if (isset($indexes))
		{
			foreach ($indexes as $field)
			{
				$down .= "\t\t\\DB::query(\"CREATE INDEX {$field}_idx ON {$table_prefix}{$subjects[1]} (`{$field}`)\")->execute();".PHP_EOL;
			}
		}

		return array($up, $down);
	}
915269
private function prepareFields(array $fields)
    {
        $preparedFields = [];

        foreach ($fields as $field) {
            $preparedFields[$field->getName()] = $field;
        }

        return $preparedFields;
    }
103201
protected function parseField($fields)
    {
        if(!isset($fields[0]))
        {
            return '*';
        }
        $result = [];
        foreach($fields as $k => $v)
        {
            if(is_numeric($k))
            {
                if($v instanceof Field)
                {
                    $field = $v;
                }
                else
                {
                    $field = new Field;
                    $field->setValue($v);
                }
            }
            else
            {
                $field = new Field(null, null, $k, $v);
            }
            $result[] = $field;
        }
        return implode(',', $result);
    }
840347
public function columns( $columns ) {
		foreach ( $this->columns as $slug => $column ) {
			// Columns can be removed when they are set to 'false'
			if ( false === $column ) {
				unset( $columns[ $slug ] );
				continue;
			}

			$columns[ $slug ] = $column['title'];
		}

		return $columns;
	}
243401
public static function quoteFields($fields) {
        $fieldArr = is_array($fields) ? $fields : explode(',', $fields);
        $resultFieldArr = array();
        foreach ($fieldArr as $field) {
            $resultFieldArr[] = self::quoteField($field);
        }

        return implode(', ', $resultFieldArr);
    }
898688
public function convertToCSVRecord(array $fields): string
    {
        $csv = new \SplTempFileObject();
        $csv->fputcsv($fields);
        $csv->rewind();
        return rtrim($csv->fgets(), "\r\n");
    }
1135202
public function tableHeadings($fields)
    {
        $output = '';
        foreach ($fields as $f) {
            $field = $this->humanReadableField($f);
            $output .= '<th>'.$field.'</th>';
        }

        return $output;
    }
716152
private function parametrize($fields = [])
    {
        return (string) implode(', ', array_map(function ($field) {
            return Dumper::export($field);
        }, $fields));
    }
1195643
public function fields($fields)
    {
        // we always have to reset the fields
        $this->fields = array();

        // when a string is given
        if (is_string($fields)) 
        {
            $fields = $this->stringArgumentToArray($fields);
        }
        // it also could be an object
        elseif (is_object($fields))
        {
            return $this->addField($fields);
        }

        // do nothing if we get nothing
        if (empty($fields) || $fields === array('*') || $fields === array('')) { return $this; }

        // add the fields
        foreach($fields as $key => $field)
        {
            // when we have a string as key we have an alias definition
            if (is_string($key))
            {
                $this->addField($key, $field);
            } else {
                $this->addField($field);
            }
        }

        return $this;
    }
498552
protected function _droppedColumnsStatement()
    {
        $columns = $this->_sql->getDroppedColumns();
        if (empty($columns)) {
            return null;
        }

        return implode(', ', array_keys($columns));
    }
1030744
public function drop($columns)
    {
        if (!is_array($columns)) {
            $columns = [$columns];
        }

        $this->compileWheres();
        $result = $this->query->replace(function ($doc) use ($columns) {
            return $doc->without($columns);
        })->run();

        return 0 == (int) $result['errors'];
    }
751798
private static function getBytes(array $fields)
    {
        $bytes = '';
        foreach (\range(-2, -32, 2) as $step) {
            $bytes = \chr(\hexdec(\substr(self::getHex($fields), $step, 2))) . $bytes;
        }

        return $bytes;
    }