Remove all "FileHasObject" edge reads and writes
[phabricator.git] / src / applications / packages / query / PhabricatorPackagesPublisherQuery.php
blobd46535c20d06a83c064ac394330ba50842bb3240
1 <?php
3 final class PhabricatorPackagesPublisherQuery
4 extends PhabricatorPackagesQuery {
6 private $ids;
7 private $phids;
8 private $publisherKeys;
10 public function withIDs(array $ids) {
11 $this->ids = $ids;
12 return $this;
15 public function withPHIDs(array $phids) {
16 $this->phids = $phids;
17 return $this;
20 public function withPublisherKeys(array $keys) {
21 $this->publisherKeys = $keys;
22 return $this;
25 public function withNameNgrams($ngrams) {
26 return $this->withNgramsConstraint(
27 new PhabricatorPackagesPublisherNameNgrams(),
28 $ngrams);
31 public function newResultObject() {
32 return new PhabricatorPackagesPublisher();
35 protected function loadPage() {
36 return $this->loadStandardPage($this->newResultObject());
39 protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
40 $where = parent::buildWhereClauseParts($conn);
42 if ($this->ids !== null) {
43 $where[] = qsprintf(
44 $conn,
45 'u.id IN (%Ld)',
46 $this->ids);
49 if ($this->phids !== null) {
50 $where[] = qsprintf(
51 $conn,
52 'u.phid IN (%Ls)',
53 $this->phids);
56 if ($this->publisherKeys !== null) {
57 $where[] = qsprintf(
58 $conn,
59 'u.publisherKey IN (%Ls)',
60 $this->publisherKeys);
63 return $where;
66 protected function getPrimaryTableAlias() {
67 return 'u';