3 final class PhabricatorTokenQuery
4 extends PhabricatorCursorPagedPolicyAwareQuery
{
8 public function withPHIDs(array $phids) {
13 protected function loadPage() {
14 $tokens = $this->getBuiltinTokens();
17 $map = array_fill_keys($this->phids
, true);
18 foreach ($tokens as $key => $token) {
19 if (empty($map[$token->getPHID()])) {
28 private function getBuiltinTokens() {
30 array('like-1', pht('Like')),
31 array('like-2', pht('Dislike')),
32 array('heart-1', pht('Love')),
33 array('heart-2', pht('Heartbreak')),
34 array('medal-1', pht('Orange Medal')),
35 array('medal-2', pht('Grey Medal')),
36 array('medal-3', pht('Yellow Medal')),
37 array('medal-4', pht('Manufacturing Defect?')),
38 array('coin-1', pht('Haypence')),
39 array('coin-2', pht('Piece of Eight')),
40 array('coin-3', pht('Doubloon')),
41 array('coin-4', pht('Mountain of Wealth')),
42 array('misc-1', pht('Pterodactyl')),
43 array('misc-2', pht('Evil Spooky Haunted Tree')),
44 array('misc-3', pht('Baby Tequila')),
45 array('misc-4', pht('The World Burns')),
46 array('emoji-1', pht('100')),
47 array('emoji-2', pht('Party Time')),
48 array('emoji-3', pht('Y So Serious')),
49 array('emoji-4', pht('Dat Boi')),
50 array('emoji-5', pht('Cup of Joe')),
51 array('emoji-6', pht('Hungry Hippo')),
52 array('emoji-7', pht('Burninate')),
53 array('emoji-8', pht('Pirate Logo')),
56 $type = PhabricatorTokenTokenPHIDType
::TYPECONST
;
59 foreach ($specs as $id => $spec) {
60 list($image, $name) = $spec;
62 $token = id(new PhabricatorToken())
65 ->setPHID('PHID-'.$type.'-'.$image);
73 public function getQueryApplicationClass() {
74 return 'PhabricatorTokensApplication';