You are here

public static function BotchaFormModel::getForms in BOTCHA Spam Prevention 6.2

Same name and namespace in other branches
  1. 6.3 model/form/botcha.form.model.inc \BotchaFormModel::getForms()
  2. 7.2 model/botcha_form.model.inc \BotchaFormModel::getForms()
  3. 7.3 model/form/botcha.form.model.inc \BotchaFormModel::getForms()
2 calls to BotchaFormModel::getForms()
Botcha::getForms in controller/botcha.controller.inc
Get a list of available BOTCHA form objects.
BotchaFormModel::getForm in model/botcha_form.model.inc

File

model/botcha_form.model.inc, line 14
Contains BotchaFormModel class.

Class

BotchaFormModel
@file Contains BotchaFormModel class.

Code

public static function getForms($parameters = array()) {

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

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