Code Coverage
 
Lines
Functions and Methods
Classes and Traits
Total
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
CRAP
100.00% covered (success)
100.00%
1 / 1
ANSI
100.00% covered (success)
100.00%
2 / 2
100.00% covered (success)
100.00%
2 / 2
2
100.00% covered (success)
100.00%
1 / 1
 quoteTable
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
 quoteField
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
1 / 1
1
1<?php
2
3namespace BO\Zmsdb\Query\Builder\Dialect;
4
5use BO\Zmsdb\Query\Builder\DialectInterface;
6
7/**
8 * ANSI
9 *
10 * Dialect for ANSI-SQL, ie what Postgres uses.
11 *
12 * @package     BO\Zmsdb\Query\Builder\Dialect
13 * @author      Alex Gisby<alex@solution10.com>
14 * @license     MIT
15 */
16class 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    public function quoteTable($table)
27    {
28        return $this->quoteStructureParts($table, '"');
29    }
30
31    /**
32     * Correctly quotes a field name, either in "name" or "table.name" format.
33     *
34     * @param   string $field
35     * @return  string
36     */
37    public function quoteField($field)
38    {
39        return $this->quoteStructureParts($field, '"', ['*']);
40    }
41}