You are here

public static function BotchaRecipe::getRecipe in BOTCHA Spam Prevention 7.2

Same name and namespace in other branches
  1. 6.2 controller/botcha_recipe.controller.inc \BotchaRecipe::getRecipe()
2 calls to BotchaRecipe::getRecipe()
Botcha::getRecipe in controller/botcha.controller.inc
Gets a recipe from cache. If it does not exists in cache - gets from database. If it does not exists there also - returns NULL.
Botcha::getRecipes in controller/botcha.controller.inc
Get a list of all BOTCHA recipes objects.

File

controller/botcha_recipe.controller.inc, line 71
Controller layer of the BotchaRecipe objects.

Class

BotchaRecipe
Abstract class to describe recipe data structure.

Code

public static function getRecipe($id, $create = TRUE) {
  $r = BotchaRecipeModel::getRecipe($id);
  $classname = $r->classname;
  $recipe = new $classname($id);
  $recipe
    ->setTitle($r->title)
    ->setDescription($r->description);
  return $recipe;
}