[ Index ]

PHP Cross Reference of Phabricator

title

Body

[close]

/src/applications/tokens/conduit/ -> TokenConduitAPIMethod.php (source)

   1  <?php
   2  
   3  abstract class TokenConduitAPIMethod extends ConduitAPIMethod {
   4  
   5    final public function getApplication() {
   6      return PhabricatorApplication::getByClass('PhabricatorTokensApplication');
   7    }
   8  
   9    public function getMethodStatus() {
  10      return self::METHOD_STATUS_UNSTABLE;
  11    }
  12  
  13    public function buildTokenDicts(array $tokens) {
  14      assert_instances_of($tokens, 'PhabricatorToken');
  15  
  16      $list = array();
  17      foreach ($tokens as $token) {
  18        $list[] = array(
  19          'id' => $token->getID(),
  20          'name' => $token->getName(),
  21          'phid' => $token->getPHID(),
  22        );
  23      }
  24  
  25      return $list;
  26    }
  27  
  28    public function buildTokenGivenDicts(array $tokens_given) {
  29      assert_instances_of($tokens_given, 'PhabricatorTokenGiven');
  30  
  31      $list = array();
  32      foreach ($tokens_given as $given) {
  33        $list[] = array(
  34          'authorPHID'  => $given->getAuthorPHID(),
  35          'objectPHID'  => $given->getObjectPHID(),
  36          'tokenPHID'   => $given->getTokenPHID(),
  37          'dateCreated' => $given->getDateCreated(),
  38        );
  39      }
  40  
  41      return $list;
  42    }
  43  
  44  }


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