Remove all "FileHasObject" edge reads and writes
[phabricator.git] / src / applications / calendar / query / PhabricatorCalendarExportQuery.php
blobc51671c8060d4ac802242c31d16c4b26f0d0ae62
1 <?php
3 final class PhabricatorCalendarExportQuery
4 extends PhabricatorCursorPagedPolicyAwareQuery {
6 private $ids;
7 private $phids;
8 private $authorPHIDs;
9 private $secretKeys;
10 private $isDisabled;
12 public function withIDs(array $ids) {
13 $this->ids = $ids;
14 return $this;
17 public function withPHIDs(array $phids) {
18 $this->phids = $phids;
19 return $this;
22 public function withAuthorPHIDs(array $phids) {
23 $this->authorPHIDs = $phids;
24 return $this;
27 public function withIsDisabled($is_disabled) {
28 $this->isDisabled = $is_disabled;
29 return $this;
32 public function withSecretKeys(array $keys) {
33 $this->secretKeys = $keys;
34 return $this;
37 public function newResultObject() {
38 return new PhabricatorCalendarExport();
41 protected function loadPage() {
42 return $this->loadStandardPage($this->newResultObject());
45 protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) {
46 $where = parent::buildWhereClauseParts($conn);
48 if ($this->ids !== null) {
49 $where[] = qsprintf(
50 $conn,
51 'export.id IN (%Ld)',
52 $this->ids);
55 if ($this->phids !== null) {
56 $where[] = qsprintf(
57 $conn,
58 'export.phid IN (%Ls)',
59 $this->phids);
62 if ($this->authorPHIDs !== null) {
63 $where[] = qsprintf(
64 $conn,
65 'export.authorPHID IN (%Ls)',
66 $this->authorPHIDs);
69 if ($this->isDisabled !== null) {
70 $where[] = qsprintf(
71 $conn,
72 'export.isDisabled = %d',
73 (int)$this->isDisabled);
76 if ($this->secretKeys !== null) {
77 $where[] = qsprintf(
78 $conn,
79 'export.secretKey IN (%Ls)',
80 $this->secretKeys);
83 return $where;
86 protected function getPrimaryTableAlias() {
87 return 'export';
90 public function getQueryApplicationClass() {
91 return 'PhabricatorCalendarApplication';