Total Complexity | 9 |
Total Lines | 49 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
5 | class PickSearchModel { |
||
6 | /** @var string */ |
||
7 | public $draft_id; |
||
8 | |||
9 | /** @var string */ |
||
10 | public $keywords; |
||
11 | |||
12 | /** @var string Three-char abbreviation */ |
||
13 | public $team; |
||
14 | |||
15 | /** @var string Three-char abbreviation */ |
||
16 | public $position; |
||
17 | |||
18 | /** @var string Sorting by player pick, ASC or DESC */ |
||
19 | public $sort; |
||
20 | |||
21 | /** @var array */ |
||
22 | public $player_results; |
||
23 | |||
24 | public function __construct($draft_id, $keywords, $team, $position, $sort) { |
||
25 | $this->draft_id = $draft_id; |
||
26 | $this->keywords = $keywords; |
||
27 | $this->team = $team; |
||
28 | $this->position = $position; |
||
29 | $this->sort = $sort; |
||
30 | } |
||
31 | |||
32 | /** |
||
33 | * Used if the strict search returns no results, empty the results (for any reason) and set the count to zero. |
||
34 | */ |
||
35 | public function emptyResultsData() { |
||
36 | unset($this->player_results); |
||
37 | $this->search_count = 0; |
||
|
|||
38 | } |
||
39 | |||
40 | public function hasName() { |
||
42 | } |
||
43 | |||
44 | public function hasTeam() { |
||
45 | return isset($this->team) && strlen($this->team) > 0; |
||
46 | } |
||
47 | |||
48 | public function hasPosition() { |
||
49 | return isset($this->position) && strlen($this->position) > 0; |
||
50 | } |
||
51 | |||
52 | public function searchCount() { |
||
54 | } |
||
55 | } |
||
56 |