Remove all "FileHasObject" edge reads and writes
[phabricator.git] / src / applications / calendar / query / PhabricatorCalendarExternalInviteeQuery.php
blobea7200e61445a0dfed7bb2114c4fabdc20b008d0
1 <?php
3 final class PhabricatorCalendarExternalInviteeQuery
4 extends PhabricatorCursorPagedPolicyAwareQuery {
6 private $ids;
7 private $phids;
8 private $names;
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 withNames(array $names) {
21 $this->names = $names;
22 return $this;
25 public function newResultObject() {
26 return new PhabricatorCalendarExternalInvitee();
29 protected function loadPage() {
30 return $this->loadStandardPage($this->newResultObject());
33 protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
34 $where = parent::buildWhereClauseParts($conn);
36 if ($this->ids !== null) {
37 $where[] = qsprintf(
38 $conn,
39 'id IN (%Ld)',
40 $this->ids);
43 if ($this->phids !== null) {
44 $where[] = qsprintf(
45 $conn,
46 'phid IN (%Ls)',
47 $this->phids);
50 if ($this->names !== null) {
51 $name_indexes = array();
52 foreach ($this->names as $name) {
53 $name_indexes[] = PhabricatorHash::digestForIndex($name);
55 $where[] = qsprintf(
56 $conn,
57 'nameIndex IN (%Ls)',
58 $name_indexes);
61 return $where;
64 public function getQueryApplicationClass() {
65 return 'PhabricatorCalendarApplication';