<?php

include __DIR__ . '/common.php';
use Ministra\Lib\w13ec15f0067ea75861e61e27c990e4ba\d3507c2999d38573a0a0c91771d70af2;
use Ministra\Lib\Video;
$today_tasks = \Ministra\Lib\w13ec15f0067ea75861e61e27c990e4ba\d3507c2999d38573a0a0c91771d70af2::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\w13ec15f0067ea75861e61e27c990e4ba\d3507c2999d38573a0a0c91771d70af2::getInstance()->delete('video_on_tasks', ['id' => $task['id']]);
    } catch (\Exception $e) {
        echo $e->getTraceAsString();
    }
}
