| Total Complexity | 4 |
| Total Lines | 54 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | abstract class AbstractTable implements ArrayAccess { |
||
| 13 | |||
| 14 | /** |
||
| 15 | * Returns the SQL reference qualifier (i.e. the table name) |
||
| 16 | * |
||
| 17 | * @return string |
||
| 18 | */ |
||
| 19 | abstract public function __toString (); |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @param int|string $column |
||
| 23 | * @return null|Column |
||
| 24 | */ |
||
| 25 | abstract public function offsetGet ($column); |
||
| 26 | |||
| 27 | /** |
||
| 28 | * @var DB |
||
| 29 | */ |
||
| 30 | protected $db; |
||
| 31 | |||
| 32 | /** |
||
| 33 | * @param DB $db |
||
| 34 | */ |
||
| 35 | public function __construct (DB $db) { |
||
| 36 | $this->db = $db; |
||
| 37 | } |
||
| 38 | |||
| 39 | /** |
||
| 40 | * @param int|string $column |
||
| 41 | * @return bool |
||
| 42 | */ |
||
| 43 | public function offsetExists ($column): bool { |
||
| 44 | return $this->offsetGet($column) !== null; |
||
| 45 | } |
||
| 46 | |||
| 47 | /** |
||
| 48 | * Throws. |
||
| 49 | * |
||
| 50 | * @param void $offset |
||
| 51 | * @param void $value |
||
| 52 | * @throws Exception |
||
| 53 | */ |
||
| 54 | final public function offsetSet ($offset, $value): void { |
||
| 56 | } |
||
| 57 | |||
| 58 | /** |
||
| 59 | * Throws. |
||
| 60 | * |
||
| 61 | * @param void $name |
||
| 62 | * @throws Exception |
||
| 63 | */ |
||
| 64 | final public function offsetUnset ($name): void { |
||
| 66 | } |
||
| 67 | } |