You are here

public static function Botcha::getRecipebooks in BOTCHA Spam Prevention 7.2

Same name and namespace in other branches
  1. 6.2 controller/botcha.controller.inc \Botcha::getRecipebooks()

Get a list of all BOTCHA recipe book objects.

Parameters

boolean $reset:

Return value

BotchaRecipebookAbstract

2 calls to Botcha::getRecipebooks()
Botcha::getAdminForm in controller/botcha.controller.inc
Get admin form.
botcha_recipebooks_form in ./botcha.admin.inc
Callback for "Recipe books" admin page. @todo ?Is it form really? Perhaps table?

File

controller/botcha.controller.inc, line 327
Contains Botcha class.

Class

Botcha
Singleton realization of botcha application.

Code

public static function getRecipebooks($reset = FALSE) {
  $recipebooks = array();
  $rbs = array_keys(BotchaRecipebookModel::getRecipebooks());
  foreach ($rbs as $rbid) {
    $recipebook_session =& $_SESSION[self::BOTCHA_SESSION_RECIPEBOOKS][$rbid];
    if (empty($recipebook_session) || $reset) {
      Botcha::setRecipebook(Botcha::getRecipebook($rbid, FALSE));
    }
    $recipebooks[$rbid] = unserialize($recipebook_session);
  }
  return $recipebooks;
}