Differential D18970 Diff 45502 src/applications/repository/query/PhabricatorRepositoryPushLogQuery.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/repository/query/PhabricatorRepositoryPushLogQuery.php
| <?php | <?php | ||||
| final class PhabricatorRepositoryPushLogQuery | final class PhabricatorRepositoryPushLogQuery | ||||
| extends PhabricatorCursorPagedPolicyAwareQuery { | extends PhabricatorCursorPagedPolicyAwareQuery { | ||||
| private $ids; | private $ids; | ||||
| private $phids; | private $phids; | ||||
| private $repositoryPHIDs; | private $repositoryPHIDs; | ||||
| private $pusherPHIDs; | private $pusherPHIDs; | ||||
| private $refTypes; | private $refTypes; | ||||
| private $newRefs; | private $newRefs; | ||||
| private $pushEventPHIDs; | private $pushEventPHIDs; | ||||
| private $epochMin; | |||||
| private $epochMax; | |||||
| public function withIDs(array $ids) { | public function withIDs(array $ids) { | ||||
| $this->ids = $ids; | $this->ids = $ids; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function withPHIDs(array $phids) { | public function withPHIDs(array $phids) { | ||||
| $this->phids = $phids; | $this->phids = $phids; | ||||
| Show All 20 Lines | public function withNewRefs(array $new_refs) { | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function withPushEventPHIDs(array $phids) { | public function withPushEventPHIDs(array $phids) { | ||||
| $this->pushEventPHIDs = $phids; | $this->pushEventPHIDs = $phids; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function withEpochBetween($min, $max) { | |||||
| $this->epochMin = $min; | |||||
| $this->epochMax = $max; | |||||
| return $this; | |||||
| } | |||||
| public function newResultObject() { | public function newResultObject() { | ||||
| return new PhabricatorRepositoryPushLog(); | return new PhabricatorRepositoryPushLog(); | ||||
| } | } | ||||
| protected function loadPage() { | protected function loadPage() { | ||||
| return $this->loadStandardPage($this->newResultObject()); | return $this->loadStandardPage($this->newResultObject()); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 65 Lines • ▼ Show 20 Lines | protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { | ||||
| if ($this->newRefs !== null) { | if ($this->newRefs !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn, | $conn, | ||||
| 'refNew IN (%Ls)', | 'refNew IN (%Ls)', | ||||
| $this->newRefs); | $this->newRefs); | ||||
| } | } | ||||
| if ($this->epochMin !== null) { | |||||
| $where[] = qsprintf( | |||||
| $conn, | |||||
| 'epoch >= %d', | |||||
| $this->epochMin); | |||||
| } | |||||
| if ($this->epochMax !== null) { | |||||
| $where[] = qsprintf( | |||||
| $conn, | |||||
| 'epoch <= %d', | |||||
| $this->epochMax); | |||||
| } | |||||
| return $where; | return $where; | ||||
| } | } | ||||
| public function getQueryApplicationClass() { | public function getQueryApplicationClass() { | ||||
| return 'PhabricatorDiffusionApplication'; | return 'PhabricatorDiffusionApplication'; | ||||
| } | } | ||||
| } | } | ||||