Construct the syntax to add a column.

@param  string $field
@param string $type
@param $meta
@return string
2248
private function addColumn($field, $type = "migration", $meta = "")
    {


        if ($type == 'migration') {

            $syntax = sprintf("\$table->%s('%s')", $field['type'], $field['name']);

            // If there are arguments for the schema type, like decimal('amount', 5, 2)
            // then we have to remember to work those in.
            if ($field['arguments']) {
                $syntax = substr($syntax, 0, -1) . ', ';

                $syntax .= implode(', ', $field['arguments']) . ')';
            }

            foreach ($field['options'] as $method => $value) {
                $syntax .= sprintf("->%s(%s)", $method, $value === true ? '' : $value);
            }

            $syntax .= ';';


        } elseif ($type == 'view-index-header') {

            // Fields to index view
            $syntax = sprintf("<th>%s", strtoupper($field['name']));
            $syntax .= '</th>';

        } elseif ($type == 'view-index-content') {

            // Fields to index view
            $syntax = sprintf("<td>{{\$%s->%s", $meta['var_name'], strtolower($field['name']));
            $syntax .= '}}</td>';

        } elseif ($type == 'view-show-content') {

            // Fields to show view
            $syntax = sprintf("<div class=\"form-group\">\n" .
                str_repeat(' ', 21) . "<label for=\"%s\">%s</label>\n" .
                str_repeat(' ', 21) . "<p class=\"form-control-static\">{{\$%s->%s}}</p>\n" .
                str_repeat(' ', 16) . "</div>", strtolower($field['name']), strtoupper($field['name']), $meta['var_name'], strtolower($field['name']));


        } elseif ($type == 'view-edit-content') {
            $syntax = $this->buildField($field, $type, $meta['var_name']);
        } elseif ($type == 'view-create-content') {
            $syntax = $this->buildField($field, $type, $meta['var_name'], false);
        } else {
            // Fields to controller
            $syntax = sprintf("\$%s->%s = \$request->input(\"%s", $meta['var_name'], $field['name'], $field['name']);
            $syntax .= '");';
        }


        return $syntax;
    }
476590
public function metaCustomColumn($column_name, $meta_field, $id)
    {
        if ($column_name === $column_name) {
            $column_name = get_post_meta($id, $meta_field, true);
            echo $column_name;
        }
    }
932711
public function declareField(string $field, string $type, string $source, string $origin = null)
    {
        $schema = $this->constant('SCHEMA')->getValue();
        $setters = $this->constant('SETTERS')->getValue();
        $validates = $this->constant('VALIDATES')->getValue();

        if (!isset($this->mapping[$type])) {
            $schema[$field] = $source . ':' . ($origin ? $origin : $field);

            $this->constant('SCHEMA')->setValue($schema);

            return;
        }

        $definition = $this->mapping[$type];

        //Source can depend on type
        $source = $definition['source'];
        $schema[$field] = $source . ':' . ($origin ? $origin : $field);

        if (!empty($definition['setter'])) {
            //Pre-defined setter
            $setters[$field] = $definition['setter'];
        }

        if (!empty($definition['validates'])) {
            //Pre-defined validation
            $validates[$field] = $definition['validates'];
        }

        $this->constant('SCHEMA')->setValue($schema);
        $this->constant('SETTERS')->setValue($setters);
        $this->constant('VALIDATES')->setValue($validates);
    }
152804
public function addColumn($name, $type, array $attributes = [])
    {
        if ($this->scope == 'alter') {
            $command = 'ADD COLUMN';
        } else {
            $command = null;
        }

        $this->sqls[] = $this->composeAddColumn(
            trim($name, '`'),
            compact('name', 'type', 'attributes', 'command')
        );

        return $this;
    }
1149982
private function AddConstants($columnsMetadata) {
        $output = "";
        foreach ($columnsMetadata as $columnName => $columnMetadata) {
            $output .= $this->_TAB2 . "const " . strtoupper($columnMetadata["Field"]) . " = \"" . $columnMetadata["Field"] . "\";" . $this->_LF;
        }
        $output .= $this->_CRLF;
        fwrite($this->writer, $output);
    }
384221
public function addField(DatabaseField $field)
    {
        $name = $field->getName();
        $this->m_fields[$name] = $field; # we key by name to prevent duplicates!
    }
67924
protected function addFieldType(&$property, Field $field)
    {
        $params = $this->getMethodParamerters($field);
        $property .= sprintf("%s('%s'%s)", $this->getPropertyBase($field->getEloquentDataMethod()), $field->name, $params);

        return $this;
    }
162781
public function add_meta( $meta_key, $meta_value ) {
		return add_metadata( $this->meta_type, $this->get_id(), $meta_key, $meta_value, true );
	}
1159408
public function getCustomField($type, $field)
    {
        if (!isset($this->customFields[$type]) ||
             !isset($this->customFields[$type][$field])) {
            return null;
        }

        return $this->customFields[$type][$field];
    }
182495
public function addField(Field $field, $key = null)
    {
        $this->fields[$key] = $field;

        return $this;
    }
559459
public function addChange(
        string $field,
        $value,
        int $type = self::TYPE_VALUE
    ): self {
        $this->changes[] = [
            'field' => $field,
            'type' => $type,
            'value' => $value,
        ];

        return $this;
    }
633792
public static function addColumn($table, $column, $type = 'text', $allowNull = false, $default = null)
    {
        $query = static::getQuery();

        return static::build(
            'ALTER TABLE',
            $query->quoteName($table),
            'ADD',
            $query->quoteName($column),
            $type,
            $allowNull ? null : 'NOT NULL',
            $default ? 'DEFAULT' . $query->quote($default) : null
        );
    }
269606
public static function forField(IField $field) : ColumnComponent
    {
        return new self($field->getName(), $field->getLabel(), ColumnComponentType::forField($field));
    }
23209
public function getFieldMetadata($contentType, $column, $field = null)
    {
        if ($field !== null) {
            if (isset($this->metadata[$contentType]['fields'][$column]['data']['fields'][$field])) {
                $metadata = $this->metadata[$contentType]['fields'][$column]['data']['fields'][$field];
            } else {
                throw new \RuntimeException(sprintf('No metadata set for field type %s', $field));
            }
        } elseif (isset($this->metadata[$contentType]['fields'][$column])) {
            $metadata = $this->metadata[$contentType]['fields'][$column];
        } else {
            throw new \RuntimeException(sprintf('%s metadata does not contain a definition for the field %s', $contentType, $column));
        }

        return $metadata;
    }
885801
def _add_column(self, label, field):
        
        # Don't call this directly.
        assert self.headers is not None
        cols = 0
        if len(self._headers) > 0:
            cols = max([int(c.cell.col) for c in self._headers])
        new_col = cols + 1
        if int(self._ws.col_count.text) < new_col:
            self._ws.col_count.text = str(new_col)
            self._update_metadata()

        cell = self._service.UpdateCell(1, new_col, label,
                                        self._ss.id, self.id)
        self._headers.append(cell)
327333
private function buildBodyRowItemAttr($field, array $attr, Metadata $meta)
    {
        $class = 'name_'.$field;

        $mappings = $meta->getMappings();

        if (isset($mappings[$field]) && !isset($mappings[$field]['targetEntity'])) {
            $class .= ' type_'.$mappings[$field]['type'];
        }

        $attr['class'] = trim(isset($attr['class']) ? $attr['class'].' '.$class : $class);

        return $attr;
    }
524276
public function addFormField($type, $params = array()) {
    $namespace = "\\iJos\\iForms\\Fields\\" . ucfirst($type);
    $field = new $namespace( $params );
    array_push($this -> form_fields, $field);
  }