41 lines
1.3 KiB
PHP
41 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Console\Commands\Grapper\Logifuture;
|
|
|
|
use App\Console\Commands\Nuh;
|
|
use DateTime;
|
|
use DateTimeZone;
|
|
|
|
class ActiveEvent
|
|
{
|
|
public static function filter($sportid, $match)
|
|
{
|
|
$event = [];
|
|
$event['status'] = 1;
|
|
$event['bmoid'] = (int) $match['id'];
|
|
$event['bkmid'] = Nuh::$options['bookmaker_id'];
|
|
$event['sportid'] = $sportid;
|
|
$event['brmatchid'] = (int) preg_replace('"\D"', '', $match['externalId']);
|
|
|
|
$date = new DateTime($match['startDate'], new DateTimeZone('UTC'));
|
|
$date->setTimezone(new DateTimeZone('Europe/Vienna'));
|
|
$event['starttime'] = $date->getTimestamp();
|
|
|
|
$event['groupname'] = addslashes($match['tournamentName']);
|
|
$event['groupid'] = (int) $match['tournamentId'];
|
|
$event['country'] = addslashes($match['sportCategory']);
|
|
$str = str_replace('||', '|', $match['description']);
|
|
$str = trim(str_replace('|', ' ', $str));
|
|
$event['event'] = addslashes($str);
|
|
if (Nuh::$options['bookmaker_id'] == 36) {
|
|
$teams = explode(' v ', $str);
|
|
} else {
|
|
$teams = explode(' - ', $str);
|
|
}
|
|
$event['home'] = addslashes($teams[0]);
|
|
$event['away'] = addslashes($teams[1]);
|
|
|
|
return $event;
|
|
}
|
|
}
|