1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-02 03:32:42 +01:00
phorge-phorge/src/applications/tokens/conduit/TokenQueryConduitAPIMethod.php

31 lines
599 B
PHP
Raw Normal View History

<?php
final class TokenQueryConduitAPIMethod extends TokenConduitAPIMethod {
public function getAPIMethodName() {
return 'token.query';
}
public function getMethodDescription() {
return pht('Query tokens.');
}
protected function defineParamTypes() {
return array();
}
protected function defineReturnType() {
return 'list<dict>';
}
protected function execute(ConduitAPIRequest $request) {
$query = id(new PhabricatorTokenQuery())
->setViewer($request->getUser());
$tokens = $query->execute();
return $this->buildTokenDicts($tokens);
}
}