@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 59 lines 1.1 kB view raw
1<?php 2 3/** 4 * @extends NuanceQuery<NuanceImportCursorData> 5 */ 6final class NuanceImportCursorDataQuery 7 extends NuanceQuery { 8 9 private $ids; 10 private $phids; 11 private $sourcePHIDs; 12 13 public function withIDs(array $ids) { 14 $this->ids = $ids; 15 return $this; 16 } 17 18 public function withPHIDs(array $phids) { 19 $this->phids = $phids; 20 return $this; 21 } 22 23 public function withSourcePHIDs(array $source_phids) { 24 $this->sourcePHIDs = $source_phids; 25 return $this; 26 } 27 28 public function newResultObject() { 29 return new NuanceImportCursorData(); 30 } 31 32 protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { 33 $where = parent::buildWhereClauseParts($conn); 34 35 if ($this->sourcePHIDs !== null) { 36 $where[] = qsprintf( 37 $conn, 38 'sourcePHID IN (%Ls)', 39 $this->sourcePHIDs); 40 } 41 42 if ($this->ids !== null) { 43 $where[] = qsprintf( 44 $conn, 45 'id IN (%Ld)', 46 $this->ids); 47 } 48 49 if ($this->phids !== null) { 50 $where[] = qsprintf( 51 $conn, 52 'phid IN (%Ls)', 53 $this->phids); 54 } 55 56 return $where; 57 } 58 59}