48 lines
1.2 KiB
PHP
48 lines
1.2 KiB
PHP
<?php
|
|
|
|
namespace App\Console\Commands\Grapper;
|
|
|
|
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 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;
|
|
|
|
default:
|
|
// code...
|
|
break;
|
|
}
|
|
}
|
|
}
|