1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace GroupByInc\API\Model; |
4
|
|
|
|
5
|
|
View Code Duplication |
class Biasing |
|
|
|
|
6
|
|
|
{ |
7
|
|
|
/** |
8
|
|
|
* @var string[] |
9
|
|
|
*/ |
10
|
|
|
private $bringToTop = array(); |
11
|
|
|
|
12
|
|
|
/** |
13
|
|
|
* @var bool |
14
|
|
|
*/ |
15
|
|
|
private $augmentBiases = false; |
16
|
|
|
|
17
|
|
|
/** |
18
|
|
|
* @var float|null |
19
|
|
|
*/ |
20
|
|
|
private $influence = null; |
21
|
|
|
|
22
|
|
|
/** |
23
|
|
|
* @var NumericBoost[] |
24
|
|
|
*/ |
25
|
|
|
private $numericBoosts = array(); |
26
|
|
|
|
27
|
|
|
/** |
28
|
|
|
* @var Bias[] |
29
|
|
|
*/ |
30
|
|
|
private $biases = array(); |
31
|
|
|
|
32
|
|
|
|
33
|
|
|
/** |
34
|
|
|
* @return string[] The list of product IDs |
35
|
|
|
*/ |
36
|
|
|
public function getBringToTop() |
37
|
|
|
{ |
38
|
|
|
return $this->bringToTop; |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* A list of product IDs to bring to the top of the result set. This list |
43
|
|
|
* will ensure that the products are included in the result set and appear in the order |
44
|
|
|
* defined. |
45
|
|
|
* |
46
|
|
|
* @param string[] $bringToTop The list of productIds. |
47
|
|
|
* |
48
|
|
|
* @return Biasing |
49
|
|
|
*/ |
50
|
|
|
public function setBringToTop($bringToTop) |
51
|
|
|
{ |
52
|
|
|
$this->bringToTop = $bringToTop; |
53
|
|
|
return $this; |
54
|
|
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* @return boolean |
58
|
|
|
*/ |
59
|
|
|
public function isAugmentBiases() |
60
|
|
|
{ |
61
|
|
|
return $this->augmentBiases; |
62
|
|
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* @param boolean $augmentBiases |
66
|
|
|
* |
67
|
|
|
* @return Biasing |
68
|
|
|
*/ |
69
|
|
|
public function setAugmentBiases($augmentBiases) |
70
|
|
|
{ |
71
|
|
|
$this->augmentBiases = $augmentBiases; |
72
|
|
|
return $this; |
73
|
|
|
} |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* @return float|null |
77
|
|
|
*/ |
78
|
|
|
public function getInfluence() |
79
|
|
|
{ |
80
|
|
|
return $this->influence; |
81
|
|
|
} |
82
|
|
|
|
83
|
|
|
/** |
84
|
|
|
* @param float|null $influence |
85
|
|
|
* |
86
|
|
|
* @return Biasing |
87
|
|
|
*/ |
88
|
|
|
public function setInfluence($influence) |
89
|
|
|
{ |
90
|
|
|
$this->influence = $influence; |
91
|
|
|
return $this; |
92
|
|
|
} |
93
|
|
|
|
94
|
|
|
/** |
95
|
|
|
* @return NumericBoost[] |
96
|
|
|
*/ |
97
|
|
|
public function getNumericBoosts() |
98
|
|
|
{ |
99
|
|
|
return $this->numericBoosts; |
100
|
|
|
} |
101
|
|
|
|
102
|
|
|
/** |
103
|
|
|
* @param NumericBoost[] $numericBoosts |
104
|
|
|
* |
105
|
|
|
* @return Biasing |
106
|
|
|
*/ |
107
|
|
|
public function setNumericBoosts($numericBoosts) |
108
|
|
|
{ |
109
|
|
|
$this->numericBoosts = $numericBoosts; |
110
|
|
|
return $this; |
111
|
|
|
} |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* @return Bias[] |
115
|
|
|
*/ |
116
|
|
|
public function getBiases() |
117
|
|
|
{ |
118
|
|
|
return $this->biases; |
119
|
|
|
} |
120
|
|
|
|
121
|
|
|
/** |
122
|
|
|
* @param Bias[] $biases |
123
|
|
|
* |
124
|
|
|
* @return Biasing |
125
|
|
|
*/ |
126
|
|
|
public function setBiases($biases) |
127
|
|
|
{ |
128
|
|
|
$this->biases = $biases; |
129
|
|
|
return $this; |
130
|
|
|
} |
131
|
|
|
} |
Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.
You can also find more detailed suggestions in the “Code” section of your repository.