[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/differential/query/ -> DifferentialTransactionQuery.php (source)

   1  <?php
   2  
   3  final class DifferentialTransactionQuery
   4    extends PhabricatorApplicationTransactionQuery {
   5  
   6    public function getTemplateApplicationTransaction() {
   7      return new DifferentialTransaction();
   8    }
   9  
  10    public static function loadUnsubmittedInlineComments(
  11      PhabricatorUser $viewer,
  12      DifferentialRevision $revision) {
  13  
  14      // TODO: This probably needs to move somewhere more central as we move
  15      // away from DifferentialInlineCommentQuery, but
  16      // PhabricatorApplicationTransactionCommentQuery is currently `final` and
  17      // I'm not yet decided on how to approach that. For now, just get the PHIDs
  18      // and then execute a PHID-based query through the standard stack.
  19  
  20      $table = new DifferentialTransactionComment();
  21      $conn_r = $table->establishConnection('r');
  22  
  23      $phids = queryfx_all(
  24        $conn_r,
  25        'SELECT phid FROM %T
  26          WHERE revisionPHID = %s
  27            AND authorPHID = %s
  28            AND transactionPHID IS NULL',
  29        $table->getTableName(),
  30        $revision->getPHID(),
  31        $viewer->getPHID());
  32  
  33      $phids = ipull($phids, 'phid');
  34      if (!$phids) {
  35        return array();
  36      }
  37  
  38      return id(new PhabricatorApplicationTransactionCommentQuery())
  39        ->setTemplate(new DifferentialTransactionComment())
  40        ->setViewer($viewer)
  41        ->withPHIDs($phids)
  42        ->execute();
  43    }
  44  
  45  }


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