Path: blob/master/src/applications/calendar/query/PhabricatorCalendarEventInviteeQuery.php
12256 views
<?php12final class PhabricatorCalendarEventInviteeQuery3extends PhabricatorCursorPagedPolicyAwareQuery {45private $ids;6private $eventPHIDs;7private $inviteePHIDs;8private $inviterPHIDs;9private $statuses;1011public function withIDs(array $ids) {12$this->ids = $ids;13return $this;14}1516public function withEventPHIDs(array $phids) {17$this->eventPHIDs = $phids;18return $this;19}2021public function withInviteePHIDs(array $phids) {22$this->inviteePHIDs = $phids;23return $this;24}2526public function withInviterPHIDs(array $phids) {27$this->inviterPHIDs = $phids;28return $this;29}3031public function withStatuses(array $statuses) {32$this->statuses = $statuses;33return $this;34}3536protected function loadPage() {37$table = new PhabricatorCalendarEventInvitee();38$conn_r = $table->establishConnection('r');3940$data = queryfx_all(41$conn_r,42'SELECT * FROM %T %Q %Q %Q',43$table->getTableName(),44$this->buildWhereClause($conn_r),45$this->buildOrderClause($conn_r),46$this->buildLimitClause($conn_r));4748return $table->loadAllFromArray($data);49}5051protected function buildWhereClause(AphrontDatabaseConnection $conn) {52$where = array();5354if ($this->ids !== null) {55$where[] = qsprintf(56$conn,57'id IN (%Ld)',58$this->ids);59}6061if ($this->eventPHIDs !== null) {62$where[] = qsprintf(63$conn,64'eventPHID IN (%Ls)',65$this->eventPHIDs);66}6768if ($this->inviteePHIDs !== null) {69$where[] = qsprintf(70$conn,71'inviteePHID IN (%Ls)',72$this->inviteePHIDs);73}7475if ($this->inviterPHIDs !== null) {76$where[] = qsprintf(77$conn,78'inviterPHID IN (%Ls)',79$this->inviterPHIDs);80}8182if ($this->statuses !== null) {83$where[] = qsprintf(84$conn,85'status = %d',86$this->statuses);87}8889$where[] = $this->buildPagingClause($conn);9091return $this->formatWhereClause($conn, $where);92}9394public function getQueryApplicationClass() {95return 'PhabricatorCalendarApplication';96}9798}99100101