blob: 204d537281919b077b11a2b2d2f1a1bcde291b94 [file] [log] [blame]
avm9996399bb77c2020-01-27 03:15:08 +01001<?php
2# Generated by the protocol buffer compiler. DO NOT EDIT!
3# source: proto/gtfs.proto
4
5namespace Gtfs\Stop;
6
7use UnexpectedValueException;
8
9/**
10 * Protobuf type <code>gtfs.Stop.LocationType</code>
11 */
12class LocationType
13{
14 /**
15 * Stop (or Platform). A location where passengers board or disembark from a transit vehicle. Is called a platform when defined within a parent_station.
16 *
17 * Generated from protobuf enum <code>STOP = 0;</code>
18 */
19 const STOP = 0;
20 /**
21 * Station. A physical structure or area that contains one or more platform.
22 *
23 * Generated from protobuf enum <code>STATION = 1;</code>
24 */
25 const STATION = 1;
26 /**
27 * 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.
28 *
29 * Generated from protobuf enum <code>ENTRANCE = 2;</code>
30 */
31 const ENTRANCE = 2;
32 /**
33 * 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.
34 *
35 * Generated from protobuf enum <code>GENERIC_NODE = 3;</code>
36 */
37 const GENERIC_NODE = 3;
38 /**
39 * Boarding Area. A specific location on a platform, where passengers can board and/or alight vehicles.
40 *
41 * Generated from protobuf enum <code>BOARDING_AREA = 4;</code>
42 */
43 const BOARDING_AREA = 4;
44
45 private static $valueToName = [
46 self::STOP => 'STOP',
47 self::STATION => 'STATION',
48 self::ENTRANCE => 'ENTRANCE',
49 self::GENERIC_NODE => 'GENERIC_NODE',
50 self::BOARDING_AREA => 'BOARDING_AREA',
51 ];
52
53 public static function name($value)
54 {
55 if (!isset(self::$valueToName[$value])) {
56 throw new UnexpectedValueException(sprintf(
57 'Enum %s has no name defined for value %s', __CLASS__, $value));
58 }
59 return self::$valueToName[$value];
60 }
61
62
63 public static function value($name)
64 {
65 $const = __CLASS__ . '::' . strtoupper($name);
66 if (!defined($const)) {
67 throw new UnexpectedValueException(sprintf(
68 'Enum %s has no value defined for name %s', __CLASS__, $name));
69 }
70 return constant($const);
71 }
72}
73
74// Adding a class alias for backwards compatibility with the previous class name.
75class_alias(LocationType::class, \Gtfs\Stop_LocationType::class);
76