protected function loadPage()
 {
     $table = new ConpherenceThread();
     $conn_r = $table->establishConnection('r');
     $data = queryfx_all($conn_r, 'SELECT thread.* FROM %T thread %Q %Q %Q %Q %Q', $table->getTableName(), $this->buildJoinClause($conn_r), $this->buildWhereClause($conn_r), $this->buildGroupClause($conn_r), $this->buildOrderClause($conn_r), $this->buildLimitClause($conn_r));
     $conpherences = $table->loadAllFromArray($data);
     if ($conpherences) {
         $conpherences = mpull($conpherences, null, 'getPHID');
         $this->loadParticipantsAndInitHandles($conpherences);
         if ($this->needParticipantCache) {
             $this->loadCoreHandles($conpherences, 'getRecentParticipantPHIDs');
         }
         if ($this->needParticipants) {
             $this->loadCoreHandles($conpherences, 'getParticipantPHIDs');
         }
         if ($this->needTransactions) {
             $this->loadTransactionsAndHandles($conpherences);
         }
         if ($this->needProfileImage) {
             $default = null;
             $file_phids = mpull($conpherences, 'getProfileImagePHID');
             $file_phids = array_filter($file_phids);
             if ($file_phids) {
                 $files = id(new PhabricatorFileQuery())->setParentQuery($this)->setViewer($this->getViewer())->withPHIDs($file_phids)->execute();
                 $files = mpull($files, null, 'getPHID');
             } else {
                 $files = array();
             }
             foreach ($conpherences as $conpherence) {
                 $file = idx($files, $conpherence->getProfileImagePHID());
                 if (!$file) {
                     if (!$default) {
                         $default = PhabricatorFile::loadBuiltin($this->getViewer(), 'conpherence.png');
                     }
                     $file = $default;
                 }
                 $conpherence->attachProfileImageFile($file);
             }
         }
     }
     return $conpherences;
 }
예제 #2
0
 protected function loadPage()
 {
     $table = new ConpherenceThread();
     $conn_r = $table->establishConnection('r');
     $data = queryfx_all($conn_r, 'SELECT conpherence_thread.* FROM %T conpherence_thread %Q %Q %Q %Q %Q', $table->getTableName(), $this->buildJoinClause($conn_r), $this->buildWhereClause($conn_r), $this->buildGroupClause($conn_r), $this->buildOrderClause($conn_r), $this->buildLimitClause($conn_r));
     $conpherences = $table->loadAllFromArray($data);
     if ($conpherences) {
         $conpherences = mpull($conpherences, null, 'getPHID');
         $this->loadParticipantsAndInitHandles($conpherences);
         if ($this->needParticipantCache) {
             $this->loadCoreHandles($conpherences, 'getRecentParticipantPHIDs');
         }
         if ($this->needWidgetData || $this->needParticipants) {
             $this->loadCoreHandles($conpherences, 'getParticipantPHIDs');
         }
         if ($this->needTransactions) {
             $this->loadTransactionsAndHandles($conpherences);
         }
         if ($this->needFilePHIDs || $this->needWidgetData) {
             $this->loadFilePHIDs($conpherences);
         }
         if ($this->needWidgetData) {
             $this->loadWidgetData($conpherences);
         }
         if ($this->needOrigPics || $this->needCropPics) {
             $this->initImages($conpherences);
         }
         if ($this->needOrigPics) {
             $this->loadOrigPics($conpherences);
         }
         if ($this->needCropPics) {
             $this->loadCropPics($conpherences);
         }
     }
     return $conpherences;
 }