Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
1 / 1 |
| TableName | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
2 | |
100.00% |
1 / 1 |
| table | |
100.00% |
4 / 4 |
|
100.00% |
1 / 1 |
2 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace BO\Zmsdb\Query\Builder; |
| 4 | |
| 5 | /** |
| 6 | * Table |
| 7 | * |
| 8 | * Used by INSERT and UPDATE to define which table to operate on. |
| 9 | * |
| 10 | * @package BO\Zmsdb\Query\Builder |
| 11 | * @author Alex Gisby<alex@solution10.com> |
| 12 | * @license MIT |
| 13 | */ |
| 14 | trait TableName |
| 15 | { |
| 16 | /** |
| 17 | * @var array Table to update |
| 18 | */ |
| 19 | protected $table = null; |
| 20 | |
| 21 | /** |
| 22 | * Set/Get the table we're updating |
| 23 | * |
| 24 | * @param string|null $table string to set, null to get |
| 25 | * @return $this|string |
| 26 | */ |
| 27 | public function table($table = null) |
| 28 | { |
| 29 | if ($table === null) { |
| 30 | return $this->table; |
| 31 | } |
| 32 | $this->table = $table; |
| 33 | return $this; |
| 34 | } |
| 35 | } |