3 final class DrydockCommandQuery
extends DrydockQuery
{
9 public function withIDs(array $ids) {
14 public function withTargetPHIDs(array $phids) {
15 $this->targetPHIDs
= $phids;
19 public function withConsumed($consumed) {
20 $this->consumed
= $consumed;
24 public function newResultObject() {
25 return new DrydockCommand();
28 protected function loadPage() {
29 return $this->loadStandardPage($this->newResultObject());
32 protected function willFilterPage(array $commands) {
33 $target_phids = mpull($commands, 'getTargetPHID');
35 $targets = id(new PhabricatorObjectQuery())
36 ->setViewer($this->getViewer())
37 ->setParentQuery($this)
38 ->withPHIDs($target_phids)
40 $targets = mpull($targets, null, 'getPHID');
42 foreach ($commands as $key => $command) {
43 $target = idx($targets, $command->getTargetPHID());
45 $this->didRejectResult($command);
46 unset($commands[$key]);
49 $command->attachCommandTarget($target);
55 protected function buildWhereClauseParts(AphrontDatabaseConnection
$conn) {
56 $where = parent
::buildWhereClauseParts($conn);
58 if ($this->ids
!== null) {
65 if ($this->targetPHIDs
!== null) {
68 'targetPHID IN (%Ls)',
72 if ($this->consumed
!== null) {
76 (int)$this->consumed
);