Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
4 / 4 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
1 / 1 |
| Alias | |
100.00% |
4 / 4 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
2 / 2 |
|
100.00% |
1 / 1 |
1 | |||
| __toString | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getAliasIdentifier | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | namespace BO\Zmsdb\Query; |
| 4 | |
| 5 | class Alias implements \BO\Zmsdb\Query\Builder\ExpressionInterface |
| 6 | { |
| 7 | use \BO\Zmsdb\Query\Builder\Dialect\Quote; |
| 8 | |
| 9 | protected $name; |
| 10 | protected $alias; |
| 11 | |
| 12 | public function __construct($name, $alias) |
| 13 | { |
| 14 | $this->name = $this->quoteStructureParts($name, '`'); |
| 15 | $this->alias = $this->quoteStructureParts($alias, '`'); |
| 16 | } |
| 17 | |
| 18 | public function __toString() |
| 19 | { |
| 20 | return $this->name . ' AS ' . $this->alias; |
| 21 | } |
| 22 | |
| 23 | public function getAliasIdentifier() |
| 24 | { |
| 25 | return $this->alias; |
| 26 | } |
| 27 | } |