You are here

closeblock.db.inc in Close Block 7

Same filename and directory in other branches
  1. 6 model/closeblock.db.inc

DB model functions.

File

model/closeblock.db.inc
View source
<?php

/**
 * @file
 * DB model functions.
 */

/**
 * Load the saved information from the db.
 */
function closeblock_db_load($params) {
  $query = db_select('closeblock', 'closeblock')
    ->fields('closeblock');
  foreach ($params as $param => $value) {
    $query
      ->condition($param, $value, '=');
  }
  $result = $query
    ->execute();
  $result = $result
    ->fetchAll();
  return $result;
}

/**
 * Delete the saved information from the db.
 */
function closeblock_db_delete($params) {
  $query = db_delete('closeblock');
  if ($params) {
    foreach ($params as $param => $value) {
      if ($param == 'theme' && ($value == 'global' || empty($value))) {
        continue;
      }
      $query
        ->condition($param, $value, '=');
    }
  }
  $result = $query
    ->execute();
  return $result;
}

Functions

Namesort descending Description
closeblock_db_delete Delete the saved information from the db.
closeblock_db_load Load the saved information from the db.