<?php
 
 
 

namespace PhpWA\Protocol\Proto\ClientPayload;

use UnexpectedValueException;




class ConnectType
{
    


    const CELLULAR_UNKNOWN = 0;
    


    const WIFI_UNKNOWN = 1;
    


    const CELLULAR_EDGE = 100;
    


    const CELLULAR_IDEN = 101;
    


    const CELLULAR_UMTS = 102;
    


    const CELLULAR_EVDO = 103;
    


    const CELLULAR_GPRS = 104;
    


    const CELLULAR_HSDPA = 105;
    


    const CELLULAR_HSUPA = 106;
    


    const CELLULAR_HSPA = 107;
    


    const CELLULAR_CDMA = 108;
    


    const CELLULAR_1XRTT = 109;
    


    const CELLULAR_EHRPD = 110;
    


    const CELLULAR_LTE = 111;
    


    const CELLULAR_HSPAP = 112;

    private static $valueToName = [
        self::CELLULAR_UNKNOWN => 'CELLULAR_UNKNOWN',
        self::WIFI_UNKNOWN => 'WIFI_UNKNOWN',
        self::CELLULAR_EDGE => 'CELLULAR_EDGE',
        self::CELLULAR_IDEN => 'CELLULAR_IDEN',
        self::CELLULAR_UMTS => 'CELLULAR_UMTS',
        self::CELLULAR_EVDO => 'CELLULAR_EVDO',
        self::CELLULAR_GPRS => 'CELLULAR_GPRS',
        self::CELLULAR_HSDPA => 'CELLULAR_HSDPA',
        self::CELLULAR_HSUPA => 'CELLULAR_HSUPA',
        self::CELLULAR_HSPA => 'CELLULAR_HSPA',
        self::CELLULAR_CDMA => 'CELLULAR_CDMA',
        self::CELLULAR_1XRTT => 'CELLULAR_1XRTT',
        self::CELLULAR_EHRPD => 'CELLULAR_EHRPD',
        self::CELLULAR_LTE => 'CELLULAR_LTE',
        self::CELLULAR_HSPAP => 'CELLULAR_HSPAP',
    ];

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

