mirror of
https://we.phorge.it/source/phorge.git
synced 2025-01-10 14:51:06 +01:00
82 lines
1.6 KiB
PHP
82 lines
1.6 KiB
PHP
|
<?php
|
||
|
|
||
|
final class PhabricatorCalendarImportQuery
|
||
|
extends PhabricatorCursorPagedPolicyAwareQuery {
|
||
|
|
||
|
private $ids;
|
||
|
private $phids;
|
||
|
private $authorPHIDs;
|
||
|
private $isDisabled;
|
||
|
|
||
|
public function withIDs(array $ids) {
|
||
|
$this->ids = $ids;
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
public function withPHIDs(array $phids) {
|
||
|
$this->phids = $phids;
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
public function withAuthorPHIDs(array $phids) {
|
||
|
$this->authorPHIDs = $phids;
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
public function withIsDisabled($is_disabled) {
|
||
|
$this->isDisabled = $is_disabled;
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
public function newResultObject() {
|
||
|
return new PhabricatorCalendarImport();
|
||
|
}
|
||
|
|
||
|
protected function loadPage() {
|
||
|
return $this->loadStandardPage($this->newResultObject());
|
||
|
}
|
||
|
|
||
|
protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
|
||
|
$where = parent::buildWhereClauseParts($conn);
|
||
|
|
||
|
if ($this->ids !== null) {
|
||
|
$where[] = qsprintf(
|
||
|
$conn,
|
||
|
'import.id IN (%Ld)',
|
||
|
$this->ids);
|
||
|
}
|
||
|
|
||
|
if ($this->phids !== null) {
|
||
|
$where[] = qsprintf(
|
||
|
$conn,
|
||
|
'import.phid IN (%Ls)',
|
||
|
$this->phids);
|
||
|
}
|
||
|
|
||
|
if ($this->authorPHIDs !== null) {
|
||
|
$where[] = qsprintf(
|
||
|
$conn,
|
||
|
'import.authorPHID IN (%Ls)',
|
||
|
$this->authorPHIDs);
|
||
|
}
|
||
|
|
||
|
if ($this->isDisabled !== null) {
|
||
|
$where[] = qsprintf(
|
||
|
$conn,
|
||
|
'import.isDisabled = %d',
|
||
|
(int)$this->isDisabled);
|
||
|
}
|
||
|
|
||
|
return $where;
|
||
|
}
|
||
|
|
||
|
protected function getPrimaryTableAlias() {
|
||
|
return 'import';
|
||
|
}
|
||
|
|
||
|
public function getQueryApplicationClass() {
|
||
|
return 'PhabricatorCalendarApplication';
|
||
|
}
|
||
|
|
||
|
}
|