Module m_config

Model for the zotonic config table.

Copyright © 2009-2020 Marc Worrell

Behaviours: zotonic_model.

Authors: Marc Worrell (marc@worrell.nl).

Description

Model for the zotonic config table. Performs a fallback to the site configuration when a key is not defined in the configuration table.

Function Index

all/1Return all configurations from the configuration table.
delete/3Delete the specified module/key combination.
get/2Get the list of configuration key for the module.
get/3Get a configuration value for the given module/key combination.
get_boolean/3
get_boolean/4
get_id/3Lookup the unique id in the config table from the module/key combination.
get_value/3
get_value/4
m_get/3Fetch the value for the key from a model source.
set_prop/5Set a "complex" config value.
set_value/4Set a "simple" config value.

Function Details

all/1

all(Context::z:context()) -> list()

Return all configurations from the configuration table. Returns a nested proplist (module, key)

delete/3

delete(Module::atom() | binary(), Key::atom() | binary(), Context::z:context()) -> ok

Delete the specified module/key combination

get/2

get(Module::atom() | binary() | undefined, Context::z:context()) -> proplists:proplist()

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/3

get(Module::atom() | binary(), Key::atom() | binary(), Context::z:context()) -> proplists:proplist() | undefined

Get a configuration value for the given module/key combination.

get_boolean/3

get_boolean(Module::atom() | binary(), Key::atom() | binary(), Context::z:context()) -> boolean()

get_boolean/4

get_boolean(Module::atom() | binary(), Key::atom() | binary(), Default::term(), Context::z:context()) -> boolean()

get_id/3

get_id(Module, Key, Context) -> any()

Lookup the unique id in the config table from the module/key combination.

get_value/3

get_value(Module::atom() | binary(), Key::atom() | binary(), Context::z:context()) -> term() | undefined

get_value/4

get_value(Module::atom() | binary(), Key::atom() | binary(), Default::term(), Context::z:context()) -> term() | undefined

m_get/3

m_get(Rest::list(), Msg::zotonic_model:opt_msg(), Context::z:context()) -> zotonic_model:return()

Fetch the value for the key from a model source

set_prop/5

set_prop(Module::atom() | binary(), Key::atom() | binary(), Prop::atom() | binary(), PropValue::term(), Context::z:context()) -> ok | {error, term()}

Set a "complex" config value.

set_value/4

set_value(Module::atom() | binary(), Key::atom() | binary(), Value::string() | binary() | atom(), Context::z:context()) -> ok | {error, term()}

Set a "simple" config value.


Generated by EDoc