Changeset View
Changeset View
Standalone View
Standalone View
src/applications/project/order/PhabricatorProjectColumnOrder.php
Show All 16 Lines | abstract class PhabricatorProjectColumnOrder | ||||
final public function getColumnOrderKey() { | final public function getColumnOrderKey() { | ||||
return $this->getPhobjectClassConstant('ORDERKEY'); | return $this->getPhobjectClassConstant('ORDERKEY'); | ||||
} | } | ||||
final public static function getAllOrders() { | final public static function getAllOrders() { | ||||
return id(new PhutilClassMapQuery()) | return id(new PhutilClassMapQuery()) | ||||
->setAncestorClass(__CLASS__) | ->setAncestorClass(__CLASS__) | ||||
->setUniqueMethod('getColumnOrderKey') | ->setUniqueMethod('getColumnOrderKey') | ||||
->setSortMethod('getMenuOrder') | |||||
->execute(); | ->execute(); | ||||
} | } | ||||
final public static function getEnabledOrders() { | |||||
$map = self::getAllOrders(); | |||||
foreach ($map as $key => $order) { | |||||
if (!$order->isEnabled()) { | |||||
unset($map[$key]); | |||||
} | |||||
} | |||||
return $map; | |||||
} | |||||
final public static function getOrderByKey($key) { | final public static function getOrderByKey($key) { | ||||
$map = self::getAllOrders(); | $map = self::getAllOrders(); | ||||
if (!isset($map[$key])) { | if (!isset($map[$key])) { | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
'No column ordering exists with key "%s".', | 'No column ordering exists with key "%s".', | ||||
$key)); | $key)); | ||||
Show All 30 Lines | abstract class PhabricatorProjectColumnOrder | ||||
protected function newMenuIconIcon() { | protected function newMenuIconIcon() { | ||||
return 'fa-sort-amount-asc'; | return 'fa-sort-amount-asc'; | ||||
} | } | ||||
abstract public function getDisplayName(); | abstract public function getDisplayName(); | ||||
abstract public function getHasHeaders(); | abstract public function getHasHeaders(); | ||||
abstract public function getCanReorder(); | abstract public function getCanReorder(); | ||||
public function getMenuOrder() { | |||||
return 9000; | |||||
} | |||||
public function isEnabled() { | |||||
return true; | |||||
} | |||||
protected function newColumnTransactions($object, array $header) { | protected function newColumnTransactions($object, array $header) { | ||||
return array(); | return array(); | ||||
} | } | ||||
final public function getHeadersForObjects(array $objects) { | final public function getHeadersForObjects(array $objects) { | ||||
$headers = $this->newHeadersForObjects($objects); | $headers = $this->newHeadersForObjects($objects); | ||||
if (!is_array($headers)) { | if (!is_array($headers)) { | ||||
▲ Show 20 Lines • Show All 105 Lines • Show Last 20 Lines |