diff options
Diffstat (limited to 'core/helpers/core_event.php')
-rw-r--r-- | core/helpers/core_event.php | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/core/helpers/core_event.php b/core/helpers/core_event.php index e430319d..64cc9376 100644 --- a/core/helpers/core_event.php +++ b/core/helpers/core_event.php @@ -34,4 +34,16 @@ class core_event_Core { static function item_before_delete($item) { access::delete_item($item); } + + static function start_batch() { + $batch_id = Session::instance()->get("batch_id"); + if (empty($batch_id)) { + $batch_id = mt_rand(); + Session::instance()->set("batch_id", $batch_id); + } + } + + static function end_batch() { + Session::instance()->delete("batch_id"); + } } |