You are here

public function VarsTestVars::getDefaults in Variable API 7

Same name and namespace in other branches
  1. 6.2 tests/vars_test.module \VarsTestVars::getDefaults()
  2. 6 tests/vars_test.module \VarsTestVars::getDefaults()
  3. 7.2 tests/vars_test.module \VarsTestVars::getDefaults()

Returns the default value for the variables used by the module.

A module using Variable API should normally implement a class derived from Vars, and overwrite this method.

Return value

An array containing information about the implemented persistent variables.

Overrides Vars::getDefaults

See also

Vars::saveDefaults()

File

tests/vars_test.module, line 18
Module for testing the Variable API module.

Class

VarsTestVars
@file

Code

public function getDefaults() {
  return array(
    'vars_test_first' => array(
      'value' => 100,
    ),
    'vars_test_second' => array(
      'value' => 200,
    ),
    'vars_test_third' => array(
      'value' => 300,
    ),
    'vars_test_fourth' => array(
      'value' => array(
        400,
      ),
    ),
    'vars_test_fifth' => array(
      'value' => array(
        'abcdefghil',
      ),
    ),
  );
}