<?php
 
 
 

namespace PhpWA\Protocol\Proto\DisappearingMode;

use UnexpectedValueException;




class Trigger
{
    


    const UNKNOWN = 0;
    


    const CHAT_SETTING = 1;
    


    const ACCOUNT_SETTING = 2;
    


    const BULK_CHANGE = 3;
    


    const BIZ_SUPPORTS_FB_HOSTING = 4;
    


    const UNKNOWN_GROUPS = 5;

    private static $valueToName = [
        self::UNKNOWN => 'UNKNOWN',
        self::CHAT_SETTING => 'CHAT_SETTING',
        self::ACCOUNT_SETTING => 'ACCOUNT_SETTING',
        self::BULK_CHANGE => 'BULK_CHANGE',
        self::BIZ_SUPPORTS_FB_HOSTING => 'BIZ_SUPPORTS_FB_HOSTING',
        self::UNKNOWN_GROUPS => 'UNKNOWN_GROUPS',
    ];

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

