/
ScoreboardMiniRequest.php
45 lines (39 loc) · 1.21 KB
/
ScoreboardMiniRequest.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
namespace JasonRoman\NbaApi\Request\Stats\Stats\Scores;
use JasonRoman\NbaApi\Constraints as ApiAssert;
use JasonRoman\NbaApi\Params\LeagueIdParam;
use JasonRoman\NbaApi\Request\Stats\Stats\AbstractStatsStatsRequest;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Get the old version of the scoreboard for a day. This seems to require header 'Referer: http://stats.nba.com/scores/'
* and works with cURL, but not with REST clients or on the web itself; cannot figure why.
*
* The dayOffset param is odd; it takes the date you specify and adds that number of days to change the date.
* This can also be negative to go backward for a number of days. Better off just leaving it as 0.
*/
class ScoreboardMiniRequest extends AbstractStatsStatsRequest
{
const ENDPOINT = '/stats/scoreboard';
/**
* @Assert\NotBlank()
* @Assert\Type("string")
* @ApiAssert\ApiRegex(LeagueIdParam::FORMAT)
*
* @var string
*/
public $leagueId;
/**
* @Assert\NotBlank()
* @Assert\Type("\DateTime")
*
* @var \DateTime
*/
public $gameDate;
/**
* @Assert\NotBlank()
* @Assert\Type("int")
*
* @var int
*/
public $dayOffset;
}