Lines
100.00%
2 / 2
Functions and Methods
100.00%
2 / 2
Classes and Traits
100.00%
1 / 1
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| ANSI | 100.00% | 2 / 2 | 100.00% | 2 / 2 | 2 | 100.00% | 1 / 1 | |||
| quoteTable | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| quoteField | 100.00% | 1 / 1 | 100.00% | 1 / 1 | 1 | |||||
| 1 | <?php | |
| 2 | ||
| 3 | namespace BO\Zmsbackend\Query\Builder\Dialect; | |
| 4 | ||
| 5 | use BO\Zmsbackend\Query\Builder\DialectInterface; | |
| 6 | ||
| 7 | /** | |
| 8 | * ANSI | |
| 9 | * | |
| 10 | * Dialect for ANSI-SQL, ie what Postgres uses. | |
| 11 | * | |
| 12 | * @package BO\Zmsbackend\Query\Builder\Dialect | |
| 13 | * @author Alex Gisby<alex@solution10.com> | |
| 14 | * @license MIT | |
| 15 | */ | |
| 16 | class ANSI implements DialectInterface | |
| 17 | { | |
| 18 | use Quote; | |
| 19 | ||
| 20 | /** | |
| 21 | * Quotes a table name correctly as per this engines dialect. | |
| 22 | * | |
| 23 | * @param string $table | |
| 24 | * @return string | |
| 25 | */ | |
| 26 | #[\Override] | |
| 27 | public function quoteTable($table) | |
| 28 | { | |
| 29 | return $this->quoteStructureParts($table, '"'); | |
| 30 | } | |
| 31 | ||
| 32 | /** | |
| 33 | * Correctly quotes a field name, either in "name" or "table.name" format. | |
| 34 | * | |
| 35 | * @param string $field | |
| 36 | * @return string | |
| 37 | */ | |
| 38 | #[\Override] | |
| 39 | public function quoteField($field) | |
| 40 | { | |
| 41 | return $this->quoteStructureParts($field, '"', ['*']); | |
| 42 | } | |
| 43 | } |