mirror of
https://we.phorge.it/source/phorge.git
synced 2025-02-03 10:28:23 +01:00
58 lines
1.1 KiB
PHP
58 lines
1.1 KiB
PHP
|
<?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());
|
||
|
}
|
||
|
|
||
|
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';
|
||
|
}
|
||
|
|
||
|
}
|