PHP Class Microweber\Providers\OptionManager

Show file Open project: microweber/microweber

Public Properties

Property Type Description
$adapters_dir
$app
$options_memory
$override_memory internal array to hold options in cache
$table_prefix
$tables array to hold options values that are not persistent in DB and changed on runtime

Public Methods

Method Description
__construct ( $app = null )
_create_mw_default_options ( )
delete ( $key, $option_group = false, $module_id = false )
get ( $key, $option_group = false, $return_full = false, $orderby = false, $module = false ) Getting options from the database.
get_all ( $params = '' )
get_by_id ( $id )
get_groups ( $is_system = false )
get_items_per_page ( $group = 'website' )
override ( $option_group, $key, $value )
save ( $data ) You can use this function to store options in the database.
set_default ( $data )
set_table_names ( $tables = false )

Method Details

__construct() public method

public __construct ( $app = null )

_create_mw_default_options() public method

delete() public method

public delete ( $key, $option_group = false, $module_id = false )

get() public method

Getting options from the database.
public get ( $key, $option_group = false, $return_full = false, $orderby = false, $module = false )
$key array|string - if array it will replace the db params
$option_group string - your option group
$return_full bool - if true it will return the whole db row as array rather then just the value
$module string - if set it will store option for module Example usage: $this->get('my_key', 'my_group');

get_all() public method

public get_all ( $params = '' )

get_by_id() public method

public get_by_id ( $id )

get_groups() public method

public get_groups ( $is_system = false )

get_items_per_page() public method

public get_items_per_page ( $group = 'website' )

override() public method

public override ( $option_group, $key, $value )

save() public method

You can use this function to store options in the database.
public save ( $data )
$data array|string Example usage: $option = array(); $option['option_value'] = 'my value'; $option['option_key'] = 'my_option'; $option['option_group'] = 'my_option_group'; mw()->option_manager->save($option);

set_default() public method

public set_default ( $data )

set_table_names() public method

public set_table_names ( $tables = false )

Property Details

$adapters_dir public property

public $adapters_dir

$app public property

public $app

$options_memory public property

public $options_memory

$override_memory public property

internal array to hold options in cache
public $override_memory

$table_prefix public property

public $table_prefix

$tables public property

array to hold options values that are not persistent in DB and changed on runtime
public $tables