Changeset View
Changeset View
Standalone View
Standalone View
src/applications/drydock/constants/DrydockLeaseStatus.php
<?php | <?php | ||||
final class DrydockLeaseStatus extends DrydockConstants { | final class DrydockLeaseStatus extends DrydockConstants { | ||||
const STATUS_PENDING = 0; | const STATUS_PENDING = 0; | ||||
const STATUS_ACQUIRING = 5; | const STATUS_ACQUIRED = 5; | ||||
const STATUS_ACTIVE = 1; | const STATUS_ACTIVE = 1; | ||||
const STATUS_RELEASED = 2; | const STATUS_RELEASED = 2; | ||||
const STATUS_BROKEN = 3; | const STATUS_BROKEN = 3; | ||||
const STATUS_EXPIRED = 4; | const STATUS_EXPIRED = 4; | ||||
public static function getNameForStatus($status) { | public static function getNameForStatus($status) { | ||||
$map = array( | $map = array( | ||||
self::STATUS_PENDING => pht('Pending'), | self::STATUS_PENDING => pht('Pending'), | ||||
self::STATUS_ACQUIRING => pht('Acquiring'), | self::STATUS_ACQUIRED => pht('Acquired'), | ||||
self::STATUS_ACTIVE => pht('Active'), | self::STATUS_ACTIVE => pht('Active'), | ||||
self::STATUS_RELEASED => pht('Released'), | self::STATUS_RELEASED => pht('Released'), | ||||
self::STATUS_BROKEN => pht('Broken'), | self::STATUS_BROKEN => pht('Broken'), | ||||
self::STATUS_EXPIRED => pht('Expired'), | self::STATUS_EXPIRED => pht('Expired'), | ||||
); | ); | ||||
return idx($map, $status, pht('Unknown')); | return idx($map, $status, pht('Unknown')); | ||||
} | } | ||||
public static function getAllStatuses() { | public static function getAllStatuses() { | ||||
return array( | return array( | ||||
self::STATUS_PENDING, | self::STATUS_PENDING, | ||||
self::STATUS_ACQUIRING, | self::STATUS_ACQUIRED, | ||||
self::STATUS_ACTIVE, | self::STATUS_ACTIVE, | ||||
self::STATUS_RELEASED, | self::STATUS_RELEASED, | ||||
self::STATUS_BROKEN, | self::STATUS_BROKEN, | ||||
self::STATUS_EXPIRED, | self::STATUS_EXPIRED, | ||||
); | ); | ||||
} | } | ||||
} | } |