Changeset View
Changeset View
Standalone View
Standalone View
src/applications/calendar/query/PhabricatorCalendarEventQuery.php
| Show All 13 Lines | final class PhabricatorCalendarEventQuery | ||||
| private $instanceSequencePairs; | private $instanceSequencePairs; | ||||
| private $isStub; | private $isStub; | ||||
| private $parentEventPHIDs; | private $parentEventPHIDs; | ||||
| private $importSourcePHIDs; | private $importSourcePHIDs; | ||||
| private $importAuthorPHIDs; | private $importAuthorPHIDs; | ||||
| private $importUIDs; | private $importUIDs; | ||||
| private $utcInitialEpochMin; | private $utcInitialEpochMin; | ||||
| private $utcInitialEpochMax; | private $utcInitialEpochMax; | ||||
| private $isImported; | |||||
| private $generateGhosts = false; | private $generateGhosts = false; | ||||
| public function newResultObject() { | public function newResultObject() { | ||||
| return new PhabricatorCalendarEvent(); | return new PhabricatorCalendarEvent(); | ||||
| } | } | ||||
| public function setGenerateGhosts($generate_ghosts) { | public function setGenerateGhosts($generate_ghosts) { | ||||
| ▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Lines | public function withImportAuthorPHIDs(array $author_phids) { | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function withImportUIDs(array $uids) { | public function withImportUIDs(array $uids) { | ||||
| $this->importUIDs = $uids; | $this->importUIDs = $uids; | ||||
| return $this; | return $this; | ||||
| } | } | ||||
| public function withIsImported($is_imported) { | |||||
| $this->isImported = $is_imported; | |||||
| return $this; | |||||
| } | |||||
| protected function getDefaultOrderVector() { | protected function getDefaultOrderVector() { | ||||
| return array('start', 'id'); | return array('start', 'id'); | ||||
| } | } | ||||
| public function getBuiltinOrders() { | public function getBuiltinOrders() { | ||||
| return array( | return array( | ||||
| 'start' => array( | 'start' => array( | ||||
| 'vector' => array('start', 'id'), | 'vector' => array('start', 'id'), | ||||
| ▲ Show 20 Lines • Show All 353 Lines • ▼ Show 20 Lines | protected function buildWhereClauseParts(AphrontDatabaseConnection $conn) { | ||||
| if ($this->importUIDs !== null) { | if ($this->importUIDs !== null) { | ||||
| $where[] = qsprintf( | $where[] = qsprintf( | ||||
| $conn, | $conn, | ||||
| 'event.importUID IN (%Ls)', | 'event.importUID IN (%Ls)', | ||||
| $this->importUIDs); | $this->importUIDs); | ||||
| } | } | ||||
| if ($this->isImported !== null) { | |||||
| if ($this->isImported) { | |||||
| $where[] = qsprintf( | |||||
| $conn, | |||||
| 'event.importSourcePHID IS NOT NULL'); | |||||
| } else { | |||||
| $where[] = qsprintf( | |||||
| $conn, | |||||
| 'event.importSourcePHID IS NULL'); | |||||
| } | |||||
| } | |||||
| return $where; | return $where; | ||||
| } | } | ||||
| protected function getPrimaryTableAlias() { | protected function getPrimaryTableAlias() { | ||||
| return 'event'; | return 'event'; | ||||
| } | } | ||||
| protected function shouldGroupQueryResultRows() { | protected function shouldGroupQueryResultRows() { | ||||
| ▲ Show 20 Lines • Show All 184 Lines • Show Last 20 Lines | |||||