Construct a column definition string from an array defintion.

@param string $name The name of the column.
@param array $cdef The column definition.
@return string Returns a string representing the column definition.
321511
protected function columnDefString($name, array $cdef) {
        $result = $this->escape($name).' '.$this->nativeDbType($cdef);

        if (!self::val('allowNull', $cdef)) {
            $result .= ' not null';
        }

        if (isset($cdef['default'])) {
            if (isset($cdef['default'])) {
                $default = $cdef['default'];

                switch ($cdef['dbtype']) {
                    case 'timestamp':
                        if (strcasecmp($default, 'current_timestamp') === 0) {
                            break;
                        }
                    default:
                        $default = $this->quote($cdef['default']);
                }

                $result .= " default $default";
            }
        }

        if (self::val('autoIncrement', $cdef)) {
            $result .= ' auto_increment';
        }

        return $result;
    }
257895
public function safeColumn($name, $noQuotes = false) {
		$name = strtolower($name);
		$name = $this->check($name);
		if (!$noQuotes) $name = $this->noKW($name);
		return $name;
	}
186533
public static function buildIndexDeclare($name, $columns, $table = null)
    {
        $query = static::getQuery();
        $cols = [];

        foreach ((array) $columns as $key => $val) {
            $col = is_numeric($key) ? $val : $key;

            $cols[] = $query->quoteName(trim(explode('(', $col)[0]));
        }

        $cols = '(' . implode(', ', $cols) . ')';

        return static::build(
            $name ? $query->quoteName($name) : null,
            $table ? 'ON ' . $query->quoteName($table) : null,
            $cols
        );
    }
74049
public static function getDescription($name)
    {
        if (self::$descriptions === null) {
            self::$descriptions = self::loadDefaultDescriptions();
        }

        return isset(self::$descriptions[$name]) ? self::$descriptions[$name] : null;
    }
1076768
public function getColumn($name, $caseInsensitive = false)
    {
        if (!$this->hasColumn($name, $caseInsensitive)) {
            return null; // just to be explicit
        }

        if ($caseInsensitive) {
            return $this->columnsByLowercaseName[strtolower($name)];
        }

        return $this->columnsByName[$name];
    }
817499
public function column(string $name): AbstractColumn
    {
        if ($this->current->hasColumn($name)) {
            //Column already exists
            return $this->current->findColumn($name);
        }

        if ($this->initial->hasColumn($name)) {
            //Fetch from initial state (this code is required to ensure column states after schema
            //flushing)
            $column = clone $this->initial->findColumn($name);
        } else {
            $column = $this->createColumn($name);
        }

        $this->current->registerColumn($column);

        return $column;
    }
778391
public function i18n_string($name, $length = 255)
    {
        $this->i18n_columns[] = $column = $this->createColumn($name, 'string', compact('length'));

        return $column;
    }
400304
public function getColumn(string $name): AbstractColumnDefinition
    {
        if (!$this->offsetExists($name)) {
            throw new Exception\UnexistentColumnException("Column '$name' does not exists in metadata");
        }

        return $this->offsetGet($name);
    }
405605
public static function create( $name = null, $conf = null ) 
	{
		if ( is_null( $name ) ) 
		{
			$name = static::$_default;
		}

		if ( !is_null( $conf ) && is_array( $conf ) )
		{
			return static::$_instances[$name] = new static( $name, $conf );
		}

		if ( !isset( static::$_instances[$name] ) )
		{
			static::$_instances[$name] = new static( $name );
		}

		return static::$_instances[$name];
	}
639274
public static function name(string $name) : ColumnLabelBuilder
    {
        $self       = new self();
        $self->name = $name;

        return new ColumnLabelBuilder($self);
    }
435496
public function Columns($Name = '') {
      if (strlen($Name) > 0) {
         if (array_key_exists($Name, $this->_Columns))
            return $this->_Columns[$Name];
         else {
            foreach($this->_Columns as $ColName => $Def) {
               if (strcasecmp($Name, $ColName) == 0)
                  return $Def;
            }
            return NULL;
         }
      }
		return $this->_Columns;
	}
599910
public function fromName($name)
    {
        self::init();
        $name = strtolower($name);
        return array_key_exists($name, self::$values) ? self::$values[$name] : null;
    }
385196
public function getColumnMeta($name = '')
    {

        $retval = array();
        $field = NULL;
        while ($field = mysqli_fetch_field($this->getResultId())) {
            $f = new stdClass();
            $f->name = $field->name;
            $f->type = $field->type;
            $f->default = $field->def;
            $f->maxLength = $field->max_length;
            $f->primaryKey = $field->primary_key;

            $retval[] = $f;
        }

        return $retval;
    }
1332558
function typeToForm($name, $type)
    {
        // get typedef
        if ($typeDef = $this->getTypeDef($type)) {
            // if struct
            if ($typeDef['phpType'] == 'struct') {
                $buffer .= '<table>';
                foreach ($typeDef['elements'] as $child => $childDef) {
                    $buffer .= "
					<tr><td align='right'>$childDef[name] (type: " . $this->getLocalPart($childDef['type']) . "):</td>
					<td><input type='text' name='parameters[" . $name . "][$childDef[name]]'></td></tr>";
                }
                $buffer .= '</table>';
                // if array
            } elseif ($typeDef['phpType'] == 'array') {
                $buffer .= '<table>';
                for ($i = 0; $i < 3; $i++) {
                    $buffer .= "
					<tr><td align='right'>array item (type: $typeDef[arrayType]):</td>
					<td><input type='text' name='parameters[" . $name . "][]'></td></tr>";
                }
                $buffer .= '</table>';
                // if scalar
            } else {
                $buffer .= "<input type='text' name='parameters[$name]'>";
            }
        } else {
            $buffer .= "<input type='text' name='parameters[$name]'>";
        }

        return $buffer;
    }
705583
protected function makeListColumn($name, $config)
    {
        if (is_string($config)) {
            $label = $config;
        }
        elseif (isset($config['label'])) {
            $label = $config['label'];
        }
        else {
            $label = studly_case($name);
        }

        /*
         * Auto configure pivot relation
         */
        if (starts_with($name, 'pivot[') && strpos($name, ']') !== false) {
            $_name = HtmlHelper::nameToArray($name);
            $relationName = array_shift($_name);
            $valueFrom = array_shift($_name);

            if (count($_name) > 0) {
                $valueFrom  .= '['.implode('][', $_name).']';
            }

            $config['relation'] = $relationName;
            $config['valueFrom'] = $valueFrom;
            $config['searchable'] = false;
        }
        /*
         * Auto configure standard relation
         */
        elseif (strpos($name, '[') !== false && strpos($name, ']') !== false) {
            $config['valueFrom'] = $name;
            $config['sortable'] = false;
            $config['searchable'] = false;
        }

        $columnType = $config['type'] ?? null;

        $column = new ListColumn($name, $label);
        $column->displayAs($columnType, $config);

        return $column;
    }
988762
public function getColumn($name)
    {
        $column = $this->_columns[$name];

        if ($column->resource !== $this) {
            $column = clone $column;
            $column->resource = $this;
            $this->_columns[$name] = $column;
        }

        return $this->_columns[$name];
    }
290683
public function column($name)
    {
        $column = new ColumnSchema($this, $name);
        $this->columns[$name] = $column;
        return $column;
    }