3 * File containing the ezcBaseSettingValueException class.
7 * @copyright Copyright (C) 2005-2009 eZ Systems AS. All rights reserved.
8 * @license http://ez.no/licenses/new_bsd New BSD License
11 * ezcBaseSettingValueExeception is thrown whenever a value to a class'
12 * configuration option is either of the wrong type, or has a wrong value.
17 class ezcBaseSettingValueException
extends ezcBaseException
20 * Constructs a new ezcBaseConfigException
22 * @param string $settingName The name of the setting where something was
24 * @param mixed $value The value that the option was tried to be set too.
25 * @param string $expectedValue A string explaining the allowed type and value range.
27 function __construct( $settingName, $value, $expectedValue = null )
29 $type = gettype( $value );
30 if ( in_array( $type, array( 'array', 'object', 'resource' ) ) )
32 $value = serialize( $value );
34 $msg = "The value '{$value}' that you were trying to assign to setting '{$settingName}' is invalid.";
37 $msg .= " Allowed values are: " . $expectedValue;
39 parent
::__construct( $msg );