| Total Complexity | 7 |
| Total Lines | 63 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 13 | class MySqlQueryBuilder extends AbstractQueryBuilder |
||
| 14 | { |
||
| 15 | const MULTIPLE_QUERY_IMPORT_LIMIT = 4000; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @return string |
||
| 19 | */ |
||
| 20 | private function getQueryHead() |
||
| 21 | { |
||
| 22 | $sql = 'INSERT '; |
||
| 23 | |||
| 24 | if (true === $this->debug) { |
||
| 25 | $sql .= 'IGNORE '; |
||
| 26 | } |
||
| 27 | |||
| 28 | $sql .= 'INTO `'.$this->table.'` ('; |
||
| 29 | $c = 1; |
||
| 30 | $values = array_keys($this->mapping); |
||
| 31 | |||
| 32 | foreach ($values as $value) { |
||
| 33 | $sql .= '`'.$value.'`'; |
||
| 34 | $sql .= $this->appendComma($c, $values); |
||
| 35 | $c++; |
||
| 36 | } |
||
| 37 | |||
| 38 | $sql .= ') VALUES '; |
||
| 39 | |||
| 40 | return $sql; |
||
| 41 | } |
||
| 42 | |||
| 43 | /** |
||
| 44 | * @return string |
||
| 45 | */ |
||
| 46 | private function getQueryTail() |
||
| 59 | } |
||
| 60 | |||
| 61 | /** |
||
| 62 | * Returns the array of insert queries |
||
| 63 | * @param string $mode |
||
| 64 | * |
||
| 65 | * @return array |
||
| 66 | */ |
||
| 67 | public function getQueries($mode = 'multiple') |
||
| 76 | } |
||
| 77 | } |
||
| 78 |