ZenMagick 0.9.1


org.zenmagick.ZMSettings

Class ZMSettings

ZMSettings

public class ZMSettings

Settings (ZenMagick's configuration).

Author:
mano
Version:
$Id: ZMSettings.php 1146 2008-06-03 21:48:25Z DerManoMann $

Method Summary
static void

addAll(array settings, boolean replace)

Add a map of settings.

static boolean

exists(string name)

Check if a given setting exists.

static mixed

get(string name, mixed default)

Get the value for the given setting name.

static array

getAll()

Get a map of all settings.

static mixed

set(string name, mixed value)

Set configuration value.

static void

setAll(array settings)

Set a map of all settings.

Method Detail

addAll

public static void addAll(array settings, boolean replace)

Add a map of settings.

Parameters:
settings - Map of settings.
replace - If true existing settings will be replaced; default is true.

exists

public static boolean exists(string name)

Check if a given setting exists.

This is useful in cases where null is a valid setting value. In that case, the get method will be ambiguous and exists should be used.

.

Parameters:
name - The setting to check.
Returns:
true if a setting with the given name exists.

get

public static mixed get(string name, mixed default)

Get the value for the given setting name.

Parameters:
name - The setting to check.
default - Optional default value to be returned if setting not found; default is null.
Returns:
The setting value or null.

getAll

public static array getAll()

Get a map of all settings.

Returns:
Map of all settings.

set

public static mixed set(string name, mixed value)

Set configuration value.

Parameters:
name - The setting to check.
value - (New) value.
Returns:
The old setting value or null.

setAll

public static void setAll(array settings)

Set a map of all settings.

Parameters:
settings - Map of settings.

ZenMagick 0.9.1