function privatemsg_sql_settings

7-2 privatemsg.module privatemsg_sql_settings($setting, $query_ids)

Query builder function to load user settings.

Related topics

File

./privatemsg.module, line 1229
Allows users to send private messages to other users.

Code

function privatemsg_sql_settings($setting, $query_ids) {
  $query = db_select('pm_setting', 'pms')->fields('pms', array('type', 'id', 'value'))->condition('pms.setting', $setting);

  $ids_condition = db_or();
  foreach ($query_ids as $type => $type_ids) {
    $ids_condition->condition(db_and()->condition('pms.type', $type)->condition('pms.id', $type_ids));
  }
  $query->condition($ids_condition);
  return $query;
}