Changeset View
Changeset View
Standalone View
Standalone View
src/applications/metamta/query/PhabricatorMetaMTAMailQuery.php
- This file was added.
<?php | |||||
final class PhabricatorMetaMTAMailQuery | |||||
extends PhabricatorCursorPagedPolicyAwareQuery { | |||||
private $ids; | |||||
private $phids; | |||||
public function withIDs(array $ids) { | |||||
$this->ids = $ids; | |||||
return $this; | |||||
} | |||||
public function withPHIDs(array $phids) { | |||||
$this->phids = $phids; | |||||
return $this; | |||||
} | |||||
protected function loadPage() { | |||||
return $this->loadStandardPage($this->newResultObject()); | |||||
epriestley: You may be able to get away with implementing `newResultObject()`, then just having this do… | |||||
} | |||||
protected function buildWhereClause(AphrontDatabaseConnection $conn_r) { | |||||
$where = array(); | |||||
if ($this->ids !== null) { | |||||
$where[] = qsprintf( | |||||
$conn_r, | |||||
'mail.id IN (%Ld)', | |||||
$this->ids); | |||||
} | |||||
if ($this->phids !== null) { | |||||
$where[] = qsprintf( | |||||
$conn_r, | |||||
'mail.phid IN (%Ls)', | |||||
$this->phids); | |||||
} | |||||
$where[] = $this->buildPagingClause($conn_r); | |||||
return $this->formatWhereClause($where); | |||||
} | |||||
protected function getPrimaryTableAlias() { | |||||
return 'mail'; | |||||
} | |||||
public function newResultObject() { | |||||
return new PhabricatorMetaMTAMail(); | |||||
} | |||||
public function getQueryApplicationClass() { | |||||
return 'PhabricatorMetaMTAApplication'; | |||||
} | |||||
} | |||||
Not Done Inline ActionsI think you don't need this if you implement getPrimaryTableAlias(). epriestley: I //think// you don't need this if you implement `getPrimaryTableAlias()`. |
You may be able to get away with implementing newResultObject(), then just having this do: