Changeset View
Changeset View
Standalone View
Standalone View
src/applications/files/query/PhabricatorFileChunkQuery.php
Show First 20 Lines • Show All 80 Lines • ▼ Show 20 Lines | if ($this->needDataFiles) { | ||||
if (!$chunks) { | if (!$chunks) { | ||||
return $chunks; | return $chunks; | ||||
} | } | ||||
} | } | ||||
return $chunks; | return $chunks; | ||||
} | } | ||||
protected function buildWhereClause(AphrontDatabaseConnection $conn_r) { | protected function buildWhereClause(AphrontDatabaseConnection $conn) { | ||||
$where = array(); | $where = array(); | ||||
if ($this->chunkHandles !== null) { | if ($this->chunkHandles !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'chunkHandle IN (%Ls)', | 'chunkHandle IN (%Ls)', | ||||
$this->chunkHandles); | $this->chunkHandles); | ||||
} | } | ||||
if ($this->rangeStart !== null) { | if ($this->rangeStart !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'byteEnd > %d', | 'byteEnd > %d', | ||||
$this->rangeStart); | $this->rangeStart); | ||||
} | } | ||||
if ($this->rangeEnd !== null) { | if ($this->rangeEnd !== null) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'byteStart < %d', | 'byteStart < %d', | ||||
$this->rangeEnd); | $this->rangeEnd); | ||||
} | } | ||||
if ($this->isComplete !== null) { | if ($this->isComplete !== null) { | ||||
if ($this->isComplete) { | if ($this->isComplete) { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'dataFilePHID IS NOT NULL'); | 'dataFilePHID IS NOT NULL'); | ||||
} else { | } else { | ||||
$where[] = qsprintf( | $where[] = qsprintf( | ||||
$conn_r, | $conn, | ||||
'dataFilePHID IS NULL'); | 'dataFilePHID IS NULL'); | ||||
} | } | ||||
} | } | ||||
$where[] = $this->buildPagingClause($conn_r); | $where[] = $this->buildPagingClause($conn); | ||||
return $this->formatWhereClause($where); | return $this->formatWhereClause($conn, $where); | ||||
} | } | ||||
public function getQueryApplicationClass() { | public function getQueryApplicationClass() { | ||||
return 'PhabricatorFilesApplication'; | return 'PhabricatorFilesApplication'; | ||||
} | } | ||||
} | } |