Changeset View
Changeset View
Standalone View
Standalone View
src/applications/conduit/method/ConduitAPIMethod.php
| Show First 20 Lines • Show All 94 Lines • ▼ Show 20 Lines | abstract class ConduitAPIMethod | ||||
| /** | /** | ||||
| * Return a key which sorts methods by application name, then method status, | * Return a key which sorts methods by application name, then method status, | ||||
| * then method name. | * then method name. | ||||
| */ | */ | ||||
| public function getSortOrder() { | public function getSortOrder() { | ||||
| $name = $this->getAPIMethodName(); | $name = $this->getAPIMethodName(); | ||||
| $map = array( | $map = array( | ||||
| ConduitAPIMethod::METHOD_STATUS_STABLE => 0, | self::METHOD_STATUS_STABLE => 0, | ||||
| ConduitAPIMethod::METHOD_STATUS_UNSTABLE => 1, | self::METHOD_STATUS_UNSTABLE => 1, | ||||
| ConduitAPIMethod::METHOD_STATUS_DEPRECATED => 2, | self::METHOD_STATUS_DEPRECATED => 2, | ||||
| ); | ); | ||||
| $ord = idx($map, $this->getMethodStatus(), 0); | $ord = idx($map, $this->getMethodStatus(), 0); | ||||
| list($head, $tail) = explode('.', $name, 2); | list($head, $tail) = explode('.', $name, 2); | ||||
| return "{$head}.{$ord}.{$tail}"; | return "{$head}.{$ord}.{$tail}"; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 262 Lines • Show Last 20 Lines | |||||