function fe_block_get_machine_name in Features Extra 7
Returns the machine name that corresponds to a given block id.
Parameters
int $bid: The block id for which to retrieve the machine name.
Return value
string | FALSE The machine name, or FALSE if it could not be found.
4 calls to fe_block_get_machine_name()
- fe_block_form_alter in fe_block/
fe_block.module - Implements hook_form_alter().
- _fe_block_build_id in fe_block/
fe_block.module - Generate block ID.
- _fe_block_get_machine_name in fe_block/
fe_block.module - Provided for backwards compatibility. Use fe_block_get_machine_name().
- _fe_block_prepare_custom_blocks_for_export in fe_block/
fe_block.module - Helper to prepare a core custom block for export.
File
- fe_block/
fe_block.module, line 1007 - Provide features components for exporting core blocks and settings.
Code
function fe_block_get_machine_name($bid) {
$machine_names =& drupal_static(__FUNCTION__);
if (!isset($machine_names[$bid])) {
$result = db_select('fe_block_boxes')
->fields('fe_block_boxes', array(
'machine_name',
))
->condition('bid', $bid)
->execute()
->fetch();
if (empty($result)) {
return FALSE;
}
$machine_names[$bid] = $result->machine_name;
}
return $machine_names[$bid];
}