public function asEnum($value, $enumName)
    {
        if (!isset($this->enums[$enumName])) {
            throw new InvalidParamException("The '$enumName' enum has not been registered in the current formatter");
        }
        if ($value === null) {
            return $this->nullDisplay;
        }
        return isset($this->enums[$enumName][$value]) ? $this->enums[$enumName][$value] : $value;
    }
public function asEnum($value, $enumName)
    {
        if (!isset($this->enums[$enumName])) {
            throw new InvalidParamException("The '$enumName' enum has not been registered in the current formatter");
        }
        if ($value === null) {
            return $this->nullDisplay;
        }
        return isset($this->enums[$enumName][$value]) ? $this->enums[$enumName][$value] : $value;
    }
public function asEnum ( $ value , $ enumName ) { if ( ! isset ( $ this -> enums [ $ enumName ] ) ) { throw new InvalidParamException ( "The '$enumName' enum has not been registered in the current formatter" ) ; } if ( $ value === null ) { return $ this -> nullDisplay ; } return isset ( $ this -> enums [ $ enumName ] [ $ value ] ) ? $ this -> enums [ $ enumName ] [ $ value ] : $ value ; }
Formats the value as an enum value.
@param mixed $value the value to be formatted
@param string $enumName
@return string the formatted result.
Formats the value as an enum value .