You are here

function commerce_billy_query_variable in Commerce Billy 7

Helper function that directly queries variable values from the database.

In certain situations variable_get() cannot be used, as it statically caches the value. e.g. we always need to most recent invoice number.

Parameters

string $var_name: The name of the variable.

6 calls to commerce_billy_query_variable()
commerce_billy_admin_form in ./commerce_billy.admin.inc
Admin settings form for invoice generation.
commerce_billy_admin_form_submit in ./commerce_billy.admin.inc
Submit handler for Commerce Billy admin form.
commerce_billy_invoice_nr_infinite in ./commerce_billy.module
Generated infinite invoice number.
commerce_billy_invoice_nr_monthly in ./commerce_billy.module
Generated monthly invoice number.
commerce_billy_invoice_nr_yearly in ./commerce_billy.module
Generated yearly invoice number.

... See full list

File

./commerce_billy.module, line 192
Commerce Billy module.

Code

function commerce_billy_query_variable($var_name) {
  return unserialize(db_select('variable', 'v')
    ->fields('v')
    ->condition('name', $var_name)
    ->execute()
    ->fetchField(1));
}