<?php
 
 
 

namespace PhpWA\Protocol\Proto\SyncActionValue\StatusPrivacyAction;

use UnexpectedValueException;




class StatusDistributionMode
{
    


    const ALLOW_LIST = 0;
    


    const DENY_LIST = 1;
    


    const CONTACTS = 2;
    


    const CLOSE_FRIENDS = 3;

    private static $valueToName = [
        self::ALLOW_LIST => 'ALLOW_LIST',
        self::DENY_LIST => 'DENY_LIST',
        self::CONTACTS => 'CONTACTS',
        self::CLOSE_FRIENDS => 'CLOSE_FRIENDS',
    ];

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

