m_config (zotonic_core v1.0.0-rc.12)
Link to this section Summary
Functions
Return all configurations from the configuration table. Returns a nested proplist (module, key)
Delete the specified module/key combination
Get the list of configuration key for the module. Returns the empty list for non existing keys, otherwise a property list with all the module settings.
Get a configuration value for the given module/key combination.
Lookup the unique id in the config table from the module/key combination.
Fetch the value for the key from a model source
Set the value of a config iff the current value is 'undefined'. Useful for initialization of new module data schemas.
Set a "complex" config value.
Set a "simple" config value.
Link to this section Functions
Link to this function
all(Context)
-spec all(z:context()) -> list().
Link to this function
delete(Module, Key, Context)
-spec delete(atom() | binary(), atom() | binary(), z:context()) -> ok.
Link to this function
get(Module, Context)
-spec get(atom() | binary() | undefined, z:context()) -> proplists:proplist().
Link to this function
get(Module, Key, Context)
-spec get(atom() | binary(), atom() | binary(), z:context()) -> proplists:proplist() | undefined.
Link to this function
get_boolean(Module, Key, Context)
-spec get_boolean(atom() | binary(), atom() | binary(), z:context()) -> boolean().
Link to this function
get_boolean(Module, Key, Default, Context)
-spec get_boolean(atom() | binary(), atom() | binary(), term(), z:context()) -> boolean().
Link to this function
get_id(Module, Key, Context)
Link to this function
get_value(Module, Key, Context)
-spec get_value(atom() | binary(), atom() | binary(), z:context()) -> term() | undefined.
Link to this function
get_value(Module, Key, Default, Context)
-spec get_value(atom() | binary(), atom() | binary(), term(), z:context()) -> term() | undefined.
Link to this function
m_get(Rest, Msg, Context)
-spec m_get(list(), zotonic_model:opt_msg(), z:context()) -> zotonic_model:return().
Link to this function
set_default_value(Module, Key, Value, Context)
-spec set_default_value(atom() | binary(), atom() | binary(), string() | binary() | atom(), z:context()) -> ok | {error, term()}.
Link to this function
set_prop(Module, Key, Prop, PropValue, Context)
-spec set_prop(atom() | binary(), atom() | binary(), atom() | binary(), term(), z:context()) -> ok | {error, term()}.
Link to this function
set_value(Module, Key, Value, Context)
-spec set_value(atom() | binary(), atom() | binary(), string() | binary() | atom(), z:context()) -> ok | {error, term()}.