3 final class AlmanacNamespaceQuery
10 public function withIDs(array $ids) {
15 public function withPHIDs(array $phids) {
16 $this->phids
= $phids;
20 public function withNames(array $names) {
21 $this->names
= $names;
25 public function withNameNgrams($ngrams) {
26 return $this->withNgramsConstraint(
27 new AlmanacNamespaceNameNgrams(),
31 public function newResultObject() {
32 return new AlmanacNamespace();
35 protected function buildWhereClauseParts(AphrontDatabaseConnection
$conn) {
36 $where = parent
::buildWhereClauseParts($conn);
38 if ($this->ids
!== null) {
41 'namespace.id IN (%Ld)',
45 if ($this->phids
!== null) {
48 'namespace.phid IN (%Ls)',
52 if ($this->names
!== null) {
55 'namespace.name IN (%Ls)',
62 protected function getPrimaryTableAlias() {
66 public function getOrderableColumns() {
67 return parent
::getOrderableColumns() +
array(
69 'table' => $this->getPrimaryTableAlias(),
78 protected function newPagingMapFromPartialObject($object) {
80 'id' => (int)$object->getID(),
81 'name' => $object->getName(),
85 public function getBuiltinOrders() {
88 'vector' => array('name'),
89 'name' => pht('Namespace Name'),
91 ) + parent
::getBuiltinOrders();
94 public function getQueryApplicationClass() {
95 return 'PhabricatorAlmanacApplication';