mirror of
https://we.phorge.it/source/phorge.git
synced 2024-11-28 09:42:41 +01:00
463d094f96
Summary: Ref T6822. Test Plan: `grep` for the following: - `->willFilterPage(` - `->loadPage(` - `->didFilterPage(` - `->getReversePaging(` - `->didFilterPage(` - `->willExecute(` - `->nextPage(` Reviewers: #blessed_reviewers, epriestley Reviewed By: #blessed_reviewers, epriestley Subscribers: hach-que, Korvin, epriestley Maniphest Tasks: T6822 Differential Revision: https://secure.phabricator.com/D11367
46 lines
1 KiB
PHP
46 lines
1 KiB
PHP
<?php
|
|
|
|
final class PhabricatorConduitLogQuery
|
|
extends PhabricatorCursorPagedPolicyAwareQuery {
|
|
|
|
private $methods;
|
|
|
|
public function withMethods(array $methods) {
|
|
$this->methods = $methods;
|
|
return $this;
|
|
}
|
|
|
|
protected function loadPage() {
|
|
$table = new PhabricatorConduitMethodCallLog();
|
|
$conn_r = $table->establishConnection('r');
|
|
|
|
$data = queryfx_all(
|
|
$conn_r,
|
|
'SELECT * FROM %T %Q %Q %Q',
|
|
$table->getTableName(),
|
|
$this->buildWhereClause($conn_r),
|
|
$this->buildOrderClause($conn_r),
|
|
$this->buildLimitClause($conn_r));
|
|
|
|
return $table->loadAllFromArray($data);;
|
|
}
|
|
|
|
private function buildWhereClause(AphrontDatabaseConnection $conn_r) {
|
|
$where = array();
|
|
|
|
if ($this->methods) {
|
|
$where[] = qsprintf(
|
|
$conn_r,
|
|
'method IN (%Ls)',
|
|
$this->methods);
|
|
}
|
|
|
|
$where[] = $this->buildPagingClause($conn_r);
|
|
return $this->formatWhereClause($where);
|
|
}
|
|
|
|
public function getQueryApplicationClass() {
|
|
return 'PhabricatorConduitApplication';
|
|
}
|
|
|
|
}
|