blob: f78300fca5242539ad77d67c419b7ca87f94cd3e [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\Transfer;
6
7use UnexpectedValueException;
8
9/**
10 * Protobuf type <code>gtfs.Transfer.TransferType</code>
11 */
12class TransferType
13{
14 /**
15 * Generated from protobuf enum <code>RECOMMENDED = 0;</code>
16 */
17 const RECOMMENDED = 0;
18 /**
19 * Generated from protobuf enum <code>TIMED = 1;</code>
20 */
21 const TIMED = 1;
22 /**
23 * Generated from protobuf enum <code>MINIMUM = 2;</code>
24 */
25 const MINIMUM = 2;
26 /**
27 * Generated from protobuf enum <code>NOT_POSSIBLE = 3;</code>
28 */
29 const NOT_POSSIBLE = 3;
30
31 private static $valueToName = [
32 self::RECOMMENDED => 'RECOMMENDED',
33 self::TIMED => 'TIMED',
34 self::MINIMUM => 'MINIMUM',
35 self::NOT_POSSIBLE => 'NOT_POSSIBLE',
36 ];
37
38 public static function name($value)
39 {
40 if (!isset(self::$valueToName[$value])) {
41 throw new UnexpectedValueException(sprintf(
42 'Enum %s has no name defined for value %s', __CLASS__, $value));
43 }
44 return self::$valueToName[$value];
45 }
46
47
48 public static function value($name)
49 {
50 $const = __CLASS__ . '::' . strtoupper($name);
51 if (!defined($const)) {
52 throw new UnexpectedValueException(sprintf(
53 'Enum %s has no value defined for name %s', __CLASS__, $name));
54 }
55 return constant($const);
56 }
57}
58
59// Adding a class alias for backwards compatibility with the previous class name.
60class_alias(TransferType::class, \Gtfs\Transfer_TransferType::class);
61