[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 <?php 2 3 final class PhabricatorTokenCountQuery 4 extends PhabricatorOffsetPagedQuery { 5 6 private $objectPHIDs; 7 8 public function withObjectPHIDs(array $object_phids) { 9 $this->objectPHIDs = $object_phids; 10 return $this; 11 } 12 13 final public function execute() { 14 $table = new PhabricatorTokenCount(); 15 $conn_r = $table->establishConnection('r'); 16 17 $rows = queryfx_all( 18 $conn_r, 19 'SELECT objectPHID, tokenCount FROM %T %Q %Q', 20 $table->getTableName(), 21 $this->buildWhereClause($conn_r), 22 $this->buildLimitClause($conn_r)); 23 24 return ipull($rows, 'tokenCount', 'objectPHID'); 25 } 26 27 private function buildWhereClause(AphrontDatabaseConnection $conn_r) { 28 $where = array(); 29 30 if ($this->objectPHIDs) { 31 $where[] = qsprintf( 32 $conn_r, 33 'objectPHID IN (%Ls)', 34 $this->objectPHIDs); 35 } 36 37 return $this->formatWhereClause($where); 38 } 39 40 }
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 |