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
MySQL
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 * MySQL
9 *
10 * MySQL SQL dialect, so back-ticks for table/column names etc.
11 *
12 * @package     BO\Zmsdb\Query\Builder\Dialect
13 * @author      Alex Gisby<alex@solution10.com>
14 * @license     MIT
15 */
16class MySQL 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}