<?php
# Generated by the protocol buffer compiler.  DO NOT EDIT!
# NO CHECKED-IN PROTOBUF GENCODE
# source: wiegand.proto

namespace OS\PB\WiegandConfig;

use UnexpectedValueException;

/**
 * Protobuf type <code>OS.PB.WiegandConfig.KeypadModes</code>
 */
class KeypadModes
{
    /**
     * Generated from protobuf enum <code>KeypadMode_NotSet = 0;</code>
     */
    const KeypadMode_NotSet = 0;
    /**
     * Wiegand Interface will not act as a keypad controller
     *
     * Generated from protobuf enum <code>KeypadMode_Disabled = 1;</code>
     */
    const KeypadMode_Disabled = 1;
    /**
     * Wiegand interface has a keypad controller, expects each key as either 4 or 8 bits 
     *
     * Generated from protobuf enum <code>KeypadMode_KeyBitBurst = 2;</code>
     */
    const KeypadMode_KeyBitBurst = 2;
    /**
     * and creates wiegand code when hash or asterisk key is pressed (prevents every combination attempts).
     *
     * Generated from protobuf enum <code>KeypadMode_KeyBitBurst_AutoEnd = 3;</code>
     */
    const KeypadMode_KeyBitBurst_AutoEnd = 3;

    private static $valueToName = [
        self::KeypadMode_NotSet => 'KeypadMode_NotSet',
        self::KeypadMode_Disabled => 'KeypadMode_Disabled',
        self::KeypadMode_KeyBitBurst => 'KeypadMode_KeyBitBurst',
        self::KeypadMode_KeyBitBurst_AutoEnd => 'KeypadMode_KeyBitBurst_AutoEnd',
    ];

    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);
    }
}

