| @@ 58-60 (lines=3) @@ | ||
| 55 | ]; |
|
| 56 | } |
|
| 57 | ||
| 58 | $sql = 'SELECT DISTINCT '.implode(', ', array_map(function ($columnDesc) { |
|
| 59 | return $this->tdbmService->getConnection()->quoteIdentifier($this->mainTable).'.'.$this->tdbmService->getConnection()->quoteIdentifier($columnDesc['column']); |
|
| 60 | }, $columnDescList)).' FROM '.$this->from; |
|
| 61 | ||
| 62 | if (count($allFetchedTables) > 1) { |
|
| 63 | list($columnDescList, $columnsList, $orderString) = $this->getColumnsList($this->mainTable, [], $this->orderBy); |
|
| @@ 70-72 (lines=3) @@ | ||
| 67 | ||
| 68 | // Let's compute the COUNT. |
|
| 69 | $pkColumnNames = $this->schema->getTable($this->mainTable)->getPrimaryKeyColumns(); |
|
| 70 | $pkColumnNames = array_map(function ($pkColumn) { |
|
| 71 | return $this->tdbmService->getConnection()->quoteIdentifier($this->mainTable).'.'.$this->tdbmService->getConnection()->quoteIdentifier($pkColumn); |
|
| 72 | }, $pkColumnNames); |
|
| 73 | ||
| 74 | $countSql = 'SELECT COUNT(DISTINCT '.implode(', ', $pkColumnNames).') FROM '.$this->from; |
|
| 75 | ||
| @@ 33-35 (lines=3) @@ | ||
| 30 | $sql = 'SELECT DISTINCT '.implode(', ', $columnsList).' FROM MAGICJOIN('.$this->mainTable.')'; |
|
| 31 | ||
| 32 | $pkColumnNames = $this->schema->getTable($this->mainTable)->getPrimaryKeyColumns(); |
|
| 33 | $pkColumnNames = array_map(function ($pkColumn) { |
|
| 34 | return $this->tdbmService->getConnection()->quoteIdentifier($this->mainTable).'.'.$this->tdbmService->getConnection()->quoteIdentifier($pkColumn); |
|
| 35 | }, $pkColumnNames); |
|
| 36 | ||
| 37 | $countSql = 'SELECT COUNT(DISTINCT '.implode(', ', $pkColumnNames).') FROM MAGICJOIN('.$this->mainTable.')'; |
|
| 38 | ||