|
@@ 341-348 (lines=8) @@
|
| 338 |
|
} |
| 339 |
|
|
| 340 |
|
// create a new column object if only strings were supplied |
| 341 |
|
if (!$columnName instanceof Column) { |
| 342 |
|
$column = new Column(); |
| 343 |
|
$column->setName($columnName); |
| 344 |
|
$column->setType($type); |
| 345 |
|
$column->setOptions($options); // map options to column methods |
| 346 |
|
} else { |
| 347 |
|
$column = $columnName; |
| 348 |
|
} |
| 349 |
|
|
| 350 |
|
// Delegate to Adapters to check column type |
| 351 |
|
if (!$this->getAdapter()->isValidColumnType($column)) { |
|
@@ 380-387 (lines=8) @@
|
| 377 |
|
public function addCustomColumn($columnName, $type = null, $options = array()) |
| 378 |
|
{ |
| 379 |
|
// create a new CustomColumn object if only strings were supplied |
| 380 |
|
if (!$columnName instanceof CustomColumn) { |
| 381 |
|
$column = new CustomColumn(); |
| 382 |
|
$column->setName($columnName); |
| 383 |
|
$column->setType($type); |
| 384 |
|
$column->setOptions($options); // map options to column methods |
| 385 |
|
} else { |
| 386 |
|
$column = $columnName; |
| 387 |
|
} |
| 388 |
|
|
| 389 |
|
$this->columns[] = $column; |
| 390 |
|
return $this; |