You are here

function image_hotspots_db_get_coordinates in Image Hotspots 7.2

Get hotspot data from database.

Parameters

array $fids: Array of files id.

string $language: Language.

2 calls to image_hotspots_db_get_coordinates()
image_hotspots_node_view in ./image_hotspots.module
Implements hook_node_view().
image_hotspots_process_form_element in ./image_hotspots.module
After build function to process the hotspot widget on forms.

File

includes/image_hotspots.db.inc, line 75
Functions for database interactions.

Code

function image_hotspots_db_get_coordinates(array $fids, $language) {
  $query = db_select('image_hotspot', 'image_hotspot');
  $query
    ->fields('image_hotspot', array(
    'coordinates',
    'fid',
  ));
  $or = db_or();
  foreach ($fids as $fid) {
    $or
      ->condition('image_hotspot.fid', $fid);
  }
  $query
    ->condition($or);
  $query
    ->condition('image_hotspot.language', $language);
  $data = $query
    ->execute()
    ->fetchAll();
  return $data;
}