You are here

function flipping_book_load in Flipping Book 7

Load a flipping_book from the database.

Parameters

int $fbid: The Flipping Book ID.

Return value

object A fully-populated flipping_book object, or FALSE if the flipping_book is not found.

5 calls to flipping_book_load()
flipping_book_delete in ./flipping_book.module
Delete a flipping_book.
flipping_book_delete_confirm_submit in includes/flipping_book.admin.inc
Executes flipping book deletion.
flipping_book_load_multiple in ./flipping_book.module
Loads flipping books from the database.
views_handler_field_flipping_book::render_link in views/views_handler_field_flipping_book.inc
Render whatever the data is as a link to the flipping_book.
views_handler_field_flipping_book_link::render in views/views_handler_field_flipping_book_link.inc
Render the field.

File

./flipping_book.module, line 111
Manage Flipping Book packages into Drupal

Code

function flipping_book_load($fbid) {
  $flipping_books =& drupal_static(__FUNCTION__);
  if (!isset($flipping_books[$fbid])) {
    $flipping_book = db_select('flipping_book', 'f')
      ->fields('f')
      ->condition('f.fbid', $fbid, '=')
      ->execute()
      ->fetchObject();
    if (empty($flipping_book)) {
      return FALSE;
    }
    $flipping_book->uri = flipping_book_dir() . '/' . $flipping_book->dir . '/index.html';
    $flipping_book->url = file_create_url($flipping_book->uri);
    $flipping_book->path = preg_replace('/^\\/?/', '', parse_url($flipping_book->url, PHP_URL_PATH));
    $flipping_books[$fbid] = $flipping_book;
  }
  return $flipping_books[$fbid];
}