Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/query/PhabricatorQuery.php
| Show All 35 Lines | protected function formatWhereSubclause(array $parts) { | ||||
| return '('.implode(') AND (', $parts).')'; | return '('.implode(') AND (', $parts).')'; | ||||
| } | } | ||||
| /** | /** | ||||
| * @task format | * @task format | ||||
| */ | */ | ||||
| protected function formatSelectClause(array $parts) { | protected function formatSelectClause( | ||||
| $parts = $this->flattenSubclause($parts); | AphrontDatabaseConnection $conn, | ||||
| if (!$parts) { | array $parts) { | ||||
| throw new Exception(pht('Can not build empty select clause!')); | |||||
| } | |||||
| return 'SELECT '.$this->formatSelectSubclause($parts); | |||||
| } | |||||
| /** | |||||
| * @task format | |||||
| */ | |||||
| protected function formatSelectSubclause(array $parts) { | |||||
| $parts = $this->flattenSubclause($parts); | $parts = $this->flattenSubclause($parts); | ||||
| if (!$parts) { | if (!$parts) { | ||||
| return null; | throw new Exception(pht('Can not build empty SELECT clause!')); | ||||
| } | } | ||||
| return implode(', ', $parts); | |||||
| return qsprintf($conn, 'SELECT %LQ', $parts); | |||||
| } | } | ||||
| /** | /** | ||||
| * @task format | * @task format | ||||
| */ | */ | ||||
| protected function formatJoinClause(array $parts) { | protected function formatJoinClause(array $parts) { | ||||
| $parts = $this->flattenSubclause($parts); | $parts = $this->flattenSubclause($parts); | ||||
| ▲ Show 20 Lines • Show All 52 Lines • Show Last 20 Lines | |||||