<?php

require __DIR__ . '/common.php';
use Ministra\Lib\bd5c9022e9a9029209e5fd05775ea272\B4291b8d8fa2d898727b1f446db1e661e;
use Ministra\Lib\Video;
$today_tasks = \Ministra\Lib\bd5c9022e9a9029209e5fd05775ea272\B4291b8d8fa2d898727b1f446db1e661e::getInstance()->from('video_on_tasks')->where(['date_on<=' => 'CURDATE()'])->get()->all();
foreach ($today_tasks as $task) {
    try {
        \Ministra\Lib\Video::switchOnById($task['video_id'], \true);
        \Ministra\Lib\bd5c9022e9a9029209e5fd05775ea272\B4291b8d8fa2d898727b1f446db1e661e::getInstance()->delete('video_on_tasks', ['id' => $task['id']]);
    } catch (\Exception $e) {
        echo $e->getTraceAsString();
    }
}
