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