Path: blob/master/src/applications/conpherence/query/ConpherenceParticipantQuery.php
12256 views
<?php12final class ConpherenceParticipantQuery extends PhabricatorOffsetPagedQuery {34private $participantPHIDs;56public function withParticipantPHIDs(array $phids) {7$this->participantPHIDs = $phids;8return $this;9}1011public function execute() {12$table = new ConpherenceParticipant();13$thread = new ConpherenceThread();1415$conn = $table->establishConnection('r');1617$data = queryfx_all(18$conn,19'SELECT * FROM %T participant JOIN %T thread20ON participant.conpherencePHID = thread.phid %Q %Q %Q',21$table->getTableName(),22$thread->getTableName(),23$this->buildWhereClause($conn),24$this->buildOrderClause($conn),25$this->buildLimitClause($conn));2627return $table->loadAllFromArray($data);28}2930protected function buildWhereClause(AphrontDatabaseConnection $conn) {31$where = array();3233if ($this->participantPHIDs !== null) {34$where[] = qsprintf(35$conn,36'participantPHID IN (%Ls)',37$this->participantPHIDs);38}3940return $this->formatWhereClause($conn, $where);41}4243private function buildOrderClause(AphrontDatabaseConnection $conn) {44return qsprintf(45$conn,46'ORDER BY thread.dateModified DESC, thread.id DESC, participant.id DESC');47}4849}505152