ids = $ids; return $this; } public function withPHIDs(array $phids) { $this->phids = $phids; return $this; } public function withStatuses(array $statuses) { $this->statuses = $statuses; return $this; } public function withDatasourceQuery($query) { $this->datasourceQuery = $query; return $this; } public function newResultObject() { return new HarbormasterBuildPlan(); } protected function loadPage() { return $this->loadStandardPage($this->newResultObject()); } protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { $where = parent::buildWhereClauseParts($conn); if ($this->ids !== null) { $where[] = qsprintf( $conn, 'id IN (%Ld)', $this->ids); } if ($this->phids !== null) { $where[] = qsprintf( $conn, 'phid IN (%Ls)', $this->phids); } if ($this->statuses !== null) { $where[] = qsprintf( $conn, 'planStatus IN (%Ls)', $this->statuses); } if (strlen($this->datasourceQuery)) { $where[] = qsprintf( $conn, 'name LIKE %>', $this->datasourceQuery); } return $where; } public function getQueryApplicationClass() { return 'PhabricatorHarbormasterApplication'; } public function getOrderableColumns() { return parent::getOrderableColumns() + array( 'name' => array( 'column' => 'name', 'type' => 'string', 'reverse' => true, ), ); } protected function getPagingValueMap($cursor, array $keys) { $plan = $this->loadCursorObject($cursor); return array( 'id' => $plan->getID(), 'name' => $plan->getName(), ); } public function getBuiltinOrders() { return array( 'name' => array( 'vector' => array('name', 'id'), 'name' => pht('Name'), ), ) + parent::getBuiltinOrders(); } }