public function column($field)
{
if (!isset($field['type'])) {
$field['type'] = 'string';
}
if (!isset($field['name'])) {
throw new InvalidArgumentException("Column name not defined.");
}
if (!isset($this->_columns[$field['type']])) {
throw new UnexpectedValueException("Column type `{$field['type']}` does not exist.");
}
$field += $this->_columns[$field['type']] + array('name' => null, 'type' => null, 'length' => null, 'precision' => null, 'default' => null, 'null' => null);
$isNumeric = preg_match('/^(integer|float|boolean)$/', $field['type']);
if ($isNumeric && $field['default'] === '') {
$field['default'] = null;
}
$field['use'] = strtolower($field['use']);
return $this->_buildColumn($field);
}