You are here

function accordions_item_load in Accordions 7

Helper function to load an existing accordion item record.

2 calls to accordions_item_load()
accordions_add_configure_accordion_form_element in ./accordions.module
Helper function for forms to use to add accordion item configuration.
accordions_preprocess_block in ./accordions.module
Implements hook_preprocess_block().

File

./accordions.module, line 399

Code

function accordions_item_load($type, $subtype, $id, $fields = array()) {
  $query = db_select('accordions', 'a')
    ->fields('a', $fields)
    ->condition('type', $type)
    ->condition('id', $id);

  // Subtype does not apply to some accordion types.
  if (isset($subtype)) {
    $query
      ->condition('subtype', $subtype);
  }
  $record = $query
    ->execute()
    ->fetchAssoc();
  return $record;
}