[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 <?php 2 3 final class AlmanacNetworkQuery 4 extends PhabricatorCursorPagedPolicyAwareQuery { 5 6 private $ids; 7 private $phids; 8 9 public function withIDs(array $ids) { 10 $this->ids = $ids; 11 return $this; 12 } 13 14 public function withPHIDs(array $phids) { 15 $this->phids = $phids; 16 return $this; 17 } 18 19 protected function loadPage() { 20 $table = new AlmanacNetwork(); 21 $conn_r = $table->establishConnection('r'); 22 23 $data = queryfx_all( 24 $conn_r, 25 'SELECT * FROM %T %Q %Q %Q', 26 $table->getTableName(), 27 $this->buildWhereClause($conn_r), 28 $this->buildOrderClause($conn_r), 29 $this->buildLimitClause($conn_r)); 30 31 return $table->loadAllFromArray($data); 32 } 33 34 protected function buildWhereClause($conn_r) { 35 $where = array(); 36 37 if ($this->ids !== null) { 38 $where[] = qsprintf( 39 $conn_r, 40 'id IN (%Ld)', 41 $this->ids); 42 } 43 44 if ($this->phids !== null) { 45 $where[] = qsprintf( 46 $conn_r, 47 'phid IN (%Ls)', 48 $this->phids); 49 } 50 51 $where[] = $this->buildPagingClause($conn_r); 52 53 return $this->formatWhereClause($where); 54 } 55 56 public function getQueryApplicationClass() { 57 return 'PhabricatorAlmanacApplication'; 58 } 59 60 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Sun Nov 30 09:20:46 2014 | Cross-referenced by PHPXref 0.7.1 |