@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
at upstream/main 76 lines 1.6 kB view raw
1<?php 2 3/** 4 * @extends PhabricatorCursorPagedPolicyAwareQuery<PhabricatorProjectColumnPosition> 5 */ 6final class PhabricatorProjectColumnPositionQuery 7 extends PhabricatorCursorPagedPolicyAwareQuery { 8 9 private $ids; 10 private $boardPHIDs; 11 private $objectPHIDs; 12 private $columnPHIDs; 13 14 public function withIDs(array $ids) { 15 $this->ids = $ids; 16 return $this; 17 } 18 19 public function withBoardPHIDs(array $board_phids) { 20 $this->boardPHIDs = $board_phids; 21 return $this; 22 } 23 24 public function withObjectPHIDs(array $object_phids) { 25 $this->objectPHIDs = $object_phids; 26 return $this; 27 } 28 29 public function withColumnPHIDs(array $column_phids) { 30 $this->columnPHIDs = $column_phids; 31 return $this; 32 } 33 34 public function newResultObject() { 35 return new PhabricatorProjectColumnPosition(); 36 } 37 38 protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { 39 $where = array(); 40 41 if ($this->ids !== null) { 42 $where[] = qsprintf( 43 $conn, 44 'id IN (%Ld)', 45 $this->ids); 46 } 47 48 if ($this->boardPHIDs !== null) { 49 $where[] = qsprintf( 50 $conn, 51 'boardPHID IN (%Ls)', 52 $this->boardPHIDs); 53 } 54 55 if ($this->objectPHIDs !== null) { 56 $where[] = qsprintf( 57 $conn, 58 'objectPHID IN (%Ls)', 59 $this->objectPHIDs); 60 } 61 62 if ($this->columnPHIDs !== null) { 63 $where[] = qsprintf( 64 $conn, 65 'columnPHID IN (%Ls)', 66 $this->columnPHIDs); 67 } 68 69 return $where; 70 } 71 72 public function getQueryApplicationClass() { 73 return PhabricatorProjectApplication::class; 74 } 75 76}