Correct Aphlict websocket URI construction after PHP8 compatibility changes
[phabricator.git] / src / applications / differential / query / DifferentialViewStateQuery.php
blob604a6de1db8c300998ceccf0c2da48ef2d7e4d12
1 <?php
3 final class DifferentialViewStateQuery
4 extends PhabricatorCursorPagedPolicyAwareQuery {
6 private $ids;
7 private $viewerPHIDs;
8 private $objectPHIDs;
10 public function withIDs(array $ids) {
11 $this->ids = $ids;
12 return $this;
15 public function withViewerPHIDs(array $phids) {
16 $this->viewerPHIDs = $phids;
17 return $this;
20 public function withObjectPHIDs(array $phids) {
21 $this->objectPHIDs = $phids;
22 return $this;
25 public function newResultObject() {
26 return new DifferentialViewState();
29 protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
30 $where = parent::buildWhereClauseParts($conn);
32 if ($this->ids !== null) {
33 $where[] = qsprintf(
34 $conn,
35 'id IN (%Ld)',
36 $this->ids);
39 if ($this->viewerPHIDs !== null) {
40 $where[] = qsprintf(
41 $conn,
42 'viewerPHID IN (%Ls)',
43 $this->viewerPHIDs);
46 if ($this->objectPHIDs !== null) {
47 $where[] = qsprintf(
48 $conn,
49 'objectPHID IN (%Ls)',
50 $this->objectPHIDs);
53 return $where;
56 public function getQueryApplicationClass() {
57 return 'PhabricatorDifferentialApplication';