You are here

function BotchaRecipe::getProperty in BOTCHA Spam Prevention 7.2

Same name and namespace in other branches
  1. 6.2 controller/botcha_recipe.controller.inc \BotchaRecipe::getProperty()
  2. 6.3 controller/recipe/botcha.recipe.controller.inc \BotchaRecipe::getProperty()
  3. 7.3 controller/recipe/botcha.recipe.controller.inc \BotchaRecipe::getProperty()

Universal getter. Wrapper getProperty is used to let class methods be used not only in getting default settings. It gives flexibility to make calls to the class methods in any order: the first of them will always calculate the property value and set the setting, while others will just get this already calculated value. It also provides consistency: we are sure that when we get some property, it is set appropriately.

22 calls to BotchaRecipe::getProperty()
BotchaRecipe::generateFormElements in controller/botcha_recipe.controller.inc
Used to get information about the recipe. Must be overridden with calling to parent::generateFormElements. @todo BotchaRecipe generateFormElements Switch from indexed array to associative.
BotchaRecipe::getField in controller/botcha_recipe.controller.inc
BotchaRecipe::getFieldClass in controller/botcha_recipe.controller.inc
BotchaRecipe::getFieldName in controller/botcha_recipe.controller.inc
BotchaRecipe::getFieldPrefix in controller/botcha_recipe.controller.inc

... See full list

File

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

Class

BotchaRecipe
Abstract class to describe recipe data structure.

Code

function getProperty(&$value, $getter_callback, $parameters = NULL) {
  if (empty($value)) {
    $value = $this
      ->{$getter_callback}($parameters);
  }
  return $value;
}