| 1 | <?php |
||
| 15 | class Table extends ArrayObject |
||
| 16 | { |
||
| 17 | /** The columns from this table |
||
| 18 | * @var Column[] */ |
||
| 19 | protected $columns; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Table constructor. |
||
| 23 | * |
||
| 24 | * @param Column[] $columns |
||
| 25 | */ |
||
| 26 | 109 | public function __construct(array $columns) |
|
| 34 | |||
| 35 | /** |
||
| 36 | * Validate $value for column $col. |
||
| 37 | * |
||
| 38 | * Returns an array with at least |
||
| 39 | * |
||
| 40 | * @param string $col |
||
| 41 | * @param mixed $value |
||
| 42 | * @return bool|Error |
||
| 43 | * @throws UnknownColumn |
||
| 44 | */ |
||
| 45 | 3 | public function validate($col, $value) |
|
| 53 | |||
| 54 | /** |
||
| 55 | * Get the Column object for $col |
||
| 56 | * |
||
| 57 | * @param string $col |
||
| 58 | * @return Column |
||
| 59 | */ |
||
| 60 | 3 | public function getColumn($col) |
|
| 64 | } |
||
| 65 |