You are here

public static function RotatingBanner::get in Rotating Banner 7.2

Same name and namespace in other branches
  1. 7 rotating_banner.classes.inc \RotatingBanner::get()

Get by Id

Parameters

int $rbid:

Return value

RotatingBanner

3 calls to RotatingBanner::get()
rotating_banner_block_save in ./rotating_banner.module
Implements hook_block_save().
rotating_banner_delete_form in ./rotating_banner.admin.inc
rotating_banner_load in ./rotating_banner.module

File

./rotating_banner.classes.inc, line 193

Class

RotatingBanner

Code

public static function get($rbid) {
  $result = db_select('rotating_banners', 'rb')
    ->fields('rb')
    ->condition('rbid', $rbid)
    ->range(0, 1)
    ->execute()
    ->fetchAll(PDO::FETCH_CLASS, 'RotatingBanner');
  if (!count($result)) {
    return FALSE;
  }
  SimpleActiveRecord::runInitialize($result);
  return array_shift($result);
}