[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/nuance/query/ -> NuanceRequestorQuery.php (source)

   1  <?php
   2  
   3  final class NuanceRequestorQuery
   4    extends NuanceQuery {
   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    public function loadPage() {
  20      $table = new NuanceRequestor();
  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      $where[] = $this->buildPagingClause($conn_r);
  38  
  39      if ($this->ids) {
  40        $where[] = qsprintf(
  41          $conn_r,
  42          'id IN (%Ld)',
  43          $this->ids);
  44      }
  45  
  46      if ($this->phids) {
  47        $where[] = qsprintf(
  48          $conn_r,
  49          'phid IN (%Ls)',
  50          $this->phids);
  51      }
  52  
  53      return $this->formatWhereClause($where);
  54    }
  55  
  56  }


Generated: Sun Nov 30 09:20:46 2014 Cross-referenced by PHPXref 0.7.1