Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F14843318
D15555.id37522.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D15555.id37522.diff
View Options
diff --git a/src/applications/badges/query/PhabricatorBadgesQuery.php b/src/applications/badges/query/PhabricatorBadgesQuery.php
--- a/src/applications/badges/query/PhabricatorBadgesQuery.php
+++ b/src/applications/badges/query/PhabricatorBadgesQuery.php
@@ -105,4 +105,36 @@
return 'PhabricatorBadgesApplication';
}
+ public function getBuiltinOrders() {
+ return array(
+ 'quality' => array(
+ 'vector' => array('quality', 'id'),
+ 'name' => pht('Rarity (Rarest First)'),
+ ),
+ 'shoddiness' => array(
+ 'vector' => array('-quality', '-id'),
+ 'name' => pht('Rarity (Most Common First)'),
+ ),
+ ) + parent::getBuiltinOrders();
+ }
+
+ public function getOrderableColumns() {
+ return array(
+ 'quality' => array(
+ 'table' => $this->getPrimaryTableAlias(),
+ 'column' => 'quality',
+ 'reverse' => true,
+ 'type' => 'int',
+ ),
+ ) + parent::getOrderableColumns();
+ }
+
+ protected function getPagingValueMap($cursor, array $keys) {
+ $badge = $this->loadCursorObject($cursor);
+ return array(
+ 'quality' => $badge->getQuality(),
+ 'id' => $badge->getID(),
+ );
+ }
+
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Feb 3, 5:37 AM (18 h, 31 m)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7086327
Default Alt Text
D15555.id37522.diff (1 KB)
Attached To
Mode
D15555: Allow ordering of badges by quality
Attached
Detach File
Event Timeline
Log In to Comment