You are here

function BotchaRecipebookAbstract::getRecipes in BOTCHA Spam Prevention 7.2

Same name and namespace in other branches
  1. 6.2 controller/botcha_recipebook.controller.inc \BotchaRecipebookAbstract::getRecipes()

@todo BotchaRecipebook getRecipes Description.

Return value

array

5 calls to BotchaRecipebookAbstract::getRecipes()
BotchaRecipebookAbstract::applyForBuildId in controller/botcha_recipebook.controller.inc
BotchaRecipebookAbstract::getCsss in controller/botcha_recipebook.controller.inc
BotchaRecipebookAbstract::getJss in controller/botcha_recipebook.controller.inc
BotchaRecipebookAbstract::getRecipesByStatus in controller/botcha_recipebook.controller.inc
Get the list of recipes by status of spam checking.
BotchaRecipebookAbstract::isSpam in controller/botcha_recipebook.controller.inc
Spam check. Currently the logic is as follows: if we could find a recipe that failed spam check - then we consider this form submission as spam and decline it.

File

controller/botcha_recipebook.controller.inc, line 166
Controller layer of the BotchaRecipebook objects.

Class

BotchaRecipebookAbstract
@file Controller layer of the BotchaRecipebook objects.

Code

function getRecipes() {
  if (!isset($this->recipes)) {
    $rs = BotchaModel::getRecipebooksRecipes(array(
      'mode' => 'recipe',
      'recipebooks' => $this->id,
    ));
    foreach ($rs as $recipe_id) {
      $this
        ->setRecipe($recipe_id);
    }
  }
  $recipes = array();
  foreach ($this->recipes as $recipe_id) {
    $recipes[$recipe_id] = Botcha::getRecipe($recipe_id, FALSE);
  }
  return $recipes;
}