Provides variable methods to services applications. Requires services.module.

'); case 'admin/modules#description': return t('Provides variable methods to services applications. Requires services.module.'); } } /** * Implementation of hook_service() */ function variable_service_service() { return array( // node.load array( '#method' => 'variable.get', '#callback' => 'variable_service_load', '#args' => array( array( '#name' => 'name', '#type' => 'string', '#description' => t('The name of the variable to return.')), array( '#name' => 'default', '#type' => 'string', '#optional' => TRUE, '#description' => t('The default value to use if this variable has never been set.'))), '#return' => 'string', '#help' => t('Return a persistent variable.')), // node.save array( '#method' => 'variable.set', '#callback' => 'variable_service_set', '#args' => array( array( '#name' => 'name', '#type' => 'string', '#description' => t('The name of the variable to set.') ), array( '#name' => 'value', '#type' => 'string', '#description' => t('The value to set.') ), ), '#help' => t('Set a persistent variable.')), ); } /** * Returns a specified variable. */ function variable_service_get($name, $default = NULL) { return variable_get($name, $default); } /** * Set a variable. */ function variable_service_set($name, $value) { variable_set($name, $value); }