Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13976582
D16996.id40888.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D16996.id40888.diff
View Options
diff --git a/src/applications/conduit/query/PhabricatorConduitTokenQuery.php b/src/applications/conduit/query/PhabricatorConduitTokenQuery.php
--- a/src/applications/conduit/query/PhabricatorConduitTokenQuery.php
+++ b/src/applications/conduit/query/PhabricatorConduitTokenQuery.php
@@ -34,48 +34,41 @@
return $this;
}
+ public function newResultObject() {
+ return new PhabricatorConduitToken();
+ }
+
protected function loadPage() {
- $table = new PhabricatorConduitToken();
- $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);
+ return $this->loadStandardPage($this->newResultObject());
}
- protected function buildWhereClause(AphrontDatabaseConnection $conn_r) {
- $where = array();
+ protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
+ $where = parent::buildWhereClauseParts($conn);
if ($this->ids !== null) {
$where[] = qsprintf(
- $conn_r,
+ $conn,
'id IN (%Ld)',
$this->ids);
}
if ($this->objectPHIDs !== null) {
$where[] = qsprintf(
- $conn_r,
+ $conn,
'objectPHID IN (%Ls)',
$this->objectPHIDs);
}
if ($this->tokens !== null) {
$where[] = qsprintf(
- $conn_r,
+ $conn,
'token IN (%Ls)',
$this->tokens);
}
if ($this->tokenTypes !== null) {
$where[] = qsprintf(
- $conn_r,
+ $conn,
'tokenType IN (%Ls)',
$this->tokenTypes);
}
@@ -83,20 +76,18 @@
if ($this->expired !== null) {
if ($this->expired) {
$where[] = qsprintf(
- $conn_r,
+ $conn,
'expires <= %d',
PhabricatorTime::getNow());
} else {
$where[] = qsprintf(
- $conn_r,
+ $conn,
'expires IS NULL OR expires > %d',
PhabricatorTime::getNow());
}
}
- $where[] = $this->buildPagingClause($conn_r);
-
- return $this->formatWhereClause($where);
+ return $where;
}
protected function willFilterPage(array $tokens) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Oct 19 2024, 2:55 PM (4 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6732657
Default Alt Text
D16996.id40888.diff (2 KB)
Attached To
Mode
D16996: Slightly modernize ConduitTokenQuery
Attached
Detach File
Event Timeline
Log In to Comment