| <?php |
| # Generated by the protocol buffer compiler. DO NOT EDIT! |
| # source: proto/gtfs.proto |
| |
| namespace Gtfs\Stop; |
| |
| use UnexpectedValueException; |
| |
| /** |
| * Protobuf type <code>gtfs.Stop.LocationType</code> |
| */ |
| class LocationType |
| { |
| /** |
| * Stop (or Platform). A location where passengers board or disembark from a transit vehicle. Is called a platform when defined within a parent_station. |
| * |
| * Generated from protobuf enum <code>STOP = 0;</code> |
| */ |
| const STOP = 0; |
| /** |
| * Station. A physical structure or area that contains one or more platform. |
| * |
| * Generated from protobuf enum <code>STATION = 1;</code> |
| */ |
| const STATION = 1; |
| /** |
| * Entrance/Exit. A location where passengers can enter or exit a station from the street. If an entrance/exit belongs to multiple stations, it can be linked by pathways to both, but the data provider must pick one of them as parent. |
| * |
| * Generated from protobuf enum <code>ENTRANCE = 2;</code> |
| */ |
| const ENTRANCE = 2; |
| /** |
| * Generic Node. A location within a station, not matching any other location_type, which can be used to link together pathways define in pathways.txt. |
| * |
| * Generated from protobuf enum <code>GENERIC_NODE = 3;</code> |
| */ |
| const GENERIC_NODE = 3; |
| /** |
| * Boarding Area. A specific location on a platform, where passengers can board and/or alight vehicles. |
| * |
| * Generated from protobuf enum <code>BOARDING_AREA = 4;</code> |
| */ |
| const BOARDING_AREA = 4; |
| |
| private static $valueToName = [ |
| self::STOP => 'STOP', |
| self::STATION => 'STATION', |
| self::ENTRANCE => 'ENTRANCE', |
| self::GENERIC_NODE => 'GENERIC_NODE', |
| self::BOARDING_AREA => 'BOARDING_AREA', |
| ]; |
| |
| public static function name($value) |
| { |
| if (!isset(self::$valueToName[$value])) { |
| throw new UnexpectedValueException(sprintf( |
| 'Enum %s has no name defined for value %s', __CLASS__, $value)); |
| } |
| return self::$valueToName[$value]; |
| } |
| |
| |
| public static function value($name) |
| { |
| $const = __CLASS__ . '::' . strtoupper($name); |
| if (!defined($const)) { |
| throw new UnexpectedValueException(sprintf( |
| 'Enum %s has no value defined for name %s', __CLASS__, $name)); |
| } |
| return constant($const); |
| } |
| } |
| |
| // Adding a class alias for backwards compatibility with the previous class name. |
| class_alias(LocationType::class, \Gtfs\Stop_LocationType::class); |
| |