<?php
 
 
 

namespace PhpWA\Protocol\Proto\StatusAttribution;

use UnexpectedValueException;




class Type
{
    


    const UNKNOWN = 0;
    


    const RESHARE = 1;
    


    const EXTERNAL_SHARE = 2;
    


    const MUSIC = 3;
    


    const STATUS_MENTION = 4;
    


    const GROUP_STATUS = 5;
    


    const RL_ATTRIBUTION = 6;
    


    const AI_CREATED = 7;
    


    const LAYOUTS = 8;

    private static $valueToName = [
        self::UNKNOWN => 'UNKNOWN',
        self::RESHARE => 'RESHARE',
        self::EXTERNAL_SHARE => 'EXTERNAL_SHARE',
        self::MUSIC => 'MUSIC',
        self::STATUS_MENTION => 'STATUS_MENTION',
        self::GROUP_STATUS => 'GROUP_STATUS',
        self::RL_ATTRIBUTION => 'RL_ATTRIBUTION',
        self::AI_CREATED => 'AI_CREATED',
        self::LAYOUTS => 'LAYOUTS',
    ];

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

