You are here

function boxes_load_delta in Boxes 7.2

Fetch a boxes object by its delta.

Parameters

$delta: String specifying the boxes delta.

$reset: A boolean indicating that the internal cache should be reset.

Return value

A fully-loaded $boxes object or FALSE if it cannot be loaded.

4 calls to boxes_load_delta()
Box::save in includes/boxes.core.inc
Override the save to add clearing of caches
boxes_block_view in ./boxes.module
Implements hook_block_view().
boxes_delta_load in ./boxes.module
Menu callback to load a boxes by the delta
BoxTests::testBoxesAPI in ./boxes.test
Test the boxes API

File

./boxes.module, line 429

Code

function boxes_load_delta($delta, $reset = FALSE) {
  $result = db_select('box', 'b')
    ->fields('b', array(
    'bid',
  ))
    ->condition('delta', $delta)
    ->execute();
  if ($bid = $result
    ->fetchField()) {
    $boxes = boxes_load_multiple(array(
      $bid,
    ), array(), $reset);
    return reset($boxes);
  }
  return FALSE;
}