You are here

public static function BotchaRecipebookModel::getRecipebooks in BOTCHA Spam Prevention 6.2

Same name and namespace in other branches
  1. 6.3 model/recipebook/botcha.recipebook.model.inc \BotchaRecipebookModel::getRecipebooks()
  2. 7.2 model/botcha_recipebook.model.inc \BotchaRecipebookModel::getRecipebooks()
  3. 7.3 model/recipebook/botcha.recipebook.model.inc \BotchaRecipebookModel::getRecipebooks()
2 calls to BotchaRecipebookModel::getRecipebooks()
Botcha::getRecipebooks in controller/botcha.controller.inc
Get a list of all BOTCHA recipe book objects.
BotchaRecipebookModel::getRecipebook in model/botcha_recipebook.model.inc

File

model/botcha_recipebook.model.inc, line 14
Contains BotchaRecipebookModel class.

Class

BotchaRecipebookModel
@file Contains BotchaRecipebookModel class.

Code

public static function getRecipebooks($parameters = NULL) {

  // Parameters to pass to the build query mechanism.
  $pars = array();
  $pars['fields'] = array();
  if (!empty($parameters['recipebooks'])) {
    $pars['conditions'][BOTCHA_MODEL_OP_IN]['id'] = (array) $parameters['recipebooks'];
  }

  // Execute query and fetch the result.
  $query = BotchaModel::buildQuery(BOTCHA_MODEL_TYPE_SELECT, 'botcha_recipebook', $pars);
  $result_query = BotchaModel::getQueryResult($query['query'], $query['query_subs']);
  $result = BotchaModel::fetchQueryResult($result_query);
  return $result;
}