<?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.LineModes</code>
 */
class LineModes
{
    /**
     * Don't change the current Wiegand Mode
     *
     * Generated from protobuf enum <code>LineMode_NotSet = 0;</code>
     */
    const LineMode_NotSet = 0;
    /**
     * Wiegand interface controls the lines directly for controlling duration of Ok, Error and Buzzer line and how long they activated (eg: Impro Keypad)
     *
     * Generated from protobuf enum <code>LineMode_Controlled = 1;</code>
     */
    const LineMode_Controlled = 1;
    /**
     * Default steady state is that ONLY the Error (Red) line is activated. It is deactivated when Ok (Green) line is activated.
     *
     * Generated from protobuf enum <code>LineMode_Pulsed = 2;</code>
     */
    const LineMode_Pulsed = 2;

    private static $valueToName = [
        self::LineMode_NotSet => 'LineMode_NotSet',
        self::LineMode_Controlled => 'LineMode_Controlled',
        self::LineMode_Pulsed => 'LineMode_Pulsed',
    ];

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

