[ Index ] |
PHP Cross Reference of Phabricator |
[Summary view] [Print] [Text view]
1 <?php 2 3 final class TokenGivenConduitAPIMethod extends TokenConduitAPIMethod { 4 5 public function getAPIMethodName() { 6 return 'token.given'; 7 } 8 9 public function getMethodDescription() { 10 return pht('Query tokens given to objects.'); 11 } 12 13 public function defineParamTypes() { 14 return array( 15 'authorPHIDs' => 'list<phid>', 16 'objectPHIDs' => 'list<phid>', 17 'tokenPHIDs' => 'list<phid>', 18 ); 19 } 20 21 public function defineErrorTypes() { 22 return array(); 23 } 24 25 public function defineReturnType() { 26 return 'list<dict>'; 27 } 28 29 public function execute(ConduitAPIRequest $request) { 30 $query = id(new PhabricatorTokenGivenQuery()) 31 ->setViewer($request->getUser()); 32 33 $author_phids = $request->getValue('authorPHIDs'); 34 if ($author_phids) { 35 $query->withAuthorPHIDs($author_phids); 36 } 37 38 $object_phids = $request->getValue('objectPHIDs'); 39 if ($object_phids) { 40 $query->withObjectPHIDs($object_phids); 41 } 42 43 $token_phids = $request->getValue('tokenPHIDs'); 44 if ($token_phids) { 45 $query->withTokenPHIDs($token_phids); 46 } 47 48 $given = $query->execute(); 49 50 return $this->buildTokenGivenDicts($given); 51 } 52 53 }
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 |