Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / calendar / query / PhabricatorCalendarExportQuery.php
blob7ef970216f4ed2c3ddf3b8d3953e09593de192eb
1 <?php
3 final class PhabricatorCalendarExportQuery
4 extends PhabricatorCursorPagedPolicyAwareQuery {
6 private $ids;
7 private $phids;
8 private $authorPHIDs;
9 private $secretKeys;
10 private $isDisabled;
12 public function withIDs(array $ids) {
13 $this->ids = $ids;
14 return $this;
17 public function withPHIDs(array $phids) {
18 $this->phids = $phids;
19 return $this;
22 public function withAuthorPHIDs(array $phids) {
23 $this->authorPHIDs = $phids;
24 return $this;
27 public function withIsDisabled($is_disabled) {
28 $this->isDisabled = $is_disabled;
29 return $this;
32 public function withSecretKeys(array $keys) {
33 $this->secretKeys = $keys;
34 return $this;
37 public function newResultObject() {
38 return new PhabricatorCalendarExport();
41 protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
42 $where = parent::buildWhereClauseParts($conn);
44 if ($this->ids !== null) {
45 $where[] = qsprintf(
46 $conn,
47 'export.id IN (%Ld)',
48 $this->ids);
51 if ($this->phids !== null) {
52 $where[] = qsprintf(
53 $conn,
54 'export.phid IN (%Ls)',
55 $this->phids);
58 if ($this->authorPHIDs !== null) {
59 $where[] = qsprintf(
60 $conn,
61 'export.authorPHID IN (%Ls)',
62 $this->authorPHIDs);
65 if ($this->isDisabled !== null) {
66 $where[] = qsprintf(
67 $conn,
68 'export.isDisabled = %d',
69 (int)$this->isDisabled);
72 if ($this->secretKeys !== null) {
73 $where[] = qsprintf(
74 $conn,
75 'export.secretKey IN (%Ls)',
76 $this->secretKeys);
79 return $where;
82 protected function getPrimaryTableAlias() {
83 return 'export';
86 public function getQueryApplicationClass() {
87 return 'PhabricatorCalendarApplication';