Lines
100.00%
4 / 4
Functions and Methods
100.00%
3 / 3
Classes and Traits
100.00%
1 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| 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\Zmsbackend\Query; | |
| 4 | ||
| 5 | class Alias implements \BO\Zmsbackend\Query\Builder\ExpressionInterface | |
| 6 | { | |
| 7 | use \BO\Zmsbackend\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 | /** @psalm-api */ | |
| 24 | public function getAliasIdentifier() | |
| 25 | { | |
| 26 | return $this->alias; | |
| 27 | } | |
| 28 | } |