52 lines
1.3 KiB
PHP
52 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Console\Commands\Grapper;
|
|
|
|
use App\Console\Commands\Grapper\Sofascore\Events;
|
|
use App\Console\Commands\Grapper\Sofascore\Tournament;
|
|
use App\Console\Commands\Nuh;
|
|
use App\Models\SofaScoreCategorie;
|
|
use App\Models\SofaScoreDay;
|
|
use App\Models\SofaScoreDayTournament;
|
|
use App\Models\SofaScoreTournament;
|
|
use App\Utilities\Notice;
|
|
|
|
class Sofascore
|
|
{
|
|
public static $auth_header = [];
|
|
|
|
public static $base_url = '';
|
|
|
|
public static $sport = [1];
|
|
|
|
public static function switch()
|
|
{
|
|
$debug = Nuh::$options['d'] ?? 0;
|
|
|
|
if (Nuh::$options['truncate']) {
|
|
SofaScoreDayTournament::truncate();
|
|
SofaScoreTournament::truncate();
|
|
SofaScoreDay::truncate();
|
|
SofaScoreCategorie::truncate();
|
|
Notice::note('Table SofaScoreDay, SofaScoreDayTournament, SofaScoreTournament, SofaScoreCategorie truncated!', 'b', 1);
|
|
}
|
|
|
|
if ($debug) {
|
|
Notice::note(Nuh::$options['sport'] . ' ' . Nuh::$options['name'], 'b');
|
|
}
|
|
|
|
switch (Nuh::$options['name']) {
|
|
case 'TOURNAMENTS':
|
|
Tournament::load();
|
|
break;
|
|
case 'EVENTS':
|
|
Events::load();
|
|
break;
|
|
|
|
default:
|
|
// code...
|
|
break;
|
|
}
|
|
}
|
|
}
|