You are here

protected function BotchaRecipe::getProperty in BOTCHA Spam Prevention 7.3

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.2 controller/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. @todo ?Do we need it?

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

... See full list

File

controller/recipe/botcha.recipe.controller.inc, line 212
Controller layer of the BotchaRecipe objects.

Class

BotchaRecipe
Abstract class to describe recipe data structure.

Code

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