Class Options

Description

Habari Options Class

Located in /system/classes/options.php (line 8)

Singleton
   |
   --Options
Method Summary
static void clear_cache ()
static void delete (string $name)
static mixed get ( $name, string|array $name...)
static array get_group (string $prefix)
static void instance ()
static void out (string $name)
static void set (string $name, [mixed $value = ''])
void get_all_options ()
mixed __get (string $name)
void __set (string $name, mixed $value)
void __unset (string $name)
Methods
static method clear_cache (line 179)

Clears memory of cached options

  • access: public
static void clear_cache ()
static method delete (line 99)

Shortcut to unset an option in the options table

  • access: public
static void delete (string $name)
  • string $name: The name of the option
static method get (line 35)

Shortcut to return the value of an option

  1.       $foo Options::get('foo')//or
  2.       list($foo$bar$bazOptions::get('foo1''bar2''baz3')//or
  3.       extract(Options::get('foo''bar''baz'))//or
  4.    list($foo$bar$bazOptions::get(array('foo1''bar2''baz3'))// useful with array_keys()

  • return: The option requested or an array of requested options, null if it does not exist
  • access: public
static mixed get ( $name, string|array $name...)
  • string|array $name...: The name(s) of the option(s) to retrieve
  • $name
static method get_group (line 53)

Fetch a group of options with a specific prefix Useful for plugins that use FormUI to automatically store options with the plugin's prefix.

  • return: An associative array of all options with that prefix
  • access: public
static array get_group (string $prefix)
  • string $prefix: The prefix to fetch
static method instance (line 17)

Enables singleton working properly

static void instance ()

Redefinition of:
Singleton::instance()
Declarations that extend this method must have the same signature (arguments and returned types) to pass E_STRICT
static method out (line 74)

Shortcut to output the value of an option

  1. Options::out('foo');

  • access: public
static void out (string $name)
  • string $name: Name of the option to output
static method set (line 88)

function set Shortcut to set the value of an option

  1. Options::set('foo''newvalue');

  • access: public
static void set (string $name, [mixed $value = ''])
  • string $name: Name of the option to set
  • mixed $value: New value of the option to store
get_all_options (line 122)

Fetch all options from the options table into local storage

  • access: public
void get_all_options ()
__get (line 109)

Retrieve an option value

  • return: Stored value for specified option
  • access: public
mixed __get (string $name)
  • string $name: Name of the option to get
__set (line 145)

Applies the option value to the options table

  • access: public
void __set (string $name, mixed $value)
  • string $name: Name of the option to set
  • mixed $value: Value to set
__unset (line 170)

Removes an option from the options table

  • access: public
void __unset (string $name)
  • string $name: The name of the option

Inherited Methods

Inherited From Singleton

Singleton::__construct()
Singleton::getInstanceOf()
Singleton::instance()

Documentation generated on Thu, 30 Oct 2008 20:31:22 +0100 by phpDocumentor 1.3.2