function _auto_block_scheduler_publish in Auto Block Scheduler 7
Method used to publish scheduled block by bid.
Parameters
int $bid: Block bid.
string $region: Block region machine name.
Throws
Exception
1 call to _auto_block_scheduler_publish()
- _auto_block_scheduler_publish_cron in ./
auto_block_scheduler.module - Publish scheduled blocks.
File
- ./
auto_block_scheduler.module, line 300 - Scheduler publishes and unpublishes block on dates specified by the user.
Code
function _auto_block_scheduler_publish($bid, $region) {
$transaction = db_transaction();
try {
db_update('block')
->fields(array(
'status' => 1,
'region' => $region,
))
->condition('bid', $bid)
->execute();
} catch (Exception $e) {
$transaction
->rollback();
watchdog_exception('auto_block_scheduler', $e);
throw $e;
}
}