1 | <?php |
||
15 | class Experiments |
||
16 | { |
||
17 | /** |
||
18 | * Optimizely API Client. |
||
19 | * @var WebMarketingROI\OptimizelyPHP\OptimizelyApiClient |
||
20 | */ |
||
21 | private $client; |
||
22 | |||
23 | /** |
||
24 | * Constructor. |
||
25 | */ |
||
26 | 7 | public function __construct($client) |
|
30 | |||
31 | /** |
||
32 | * Get a list of all the experiments by Project or Campaign |
||
33 | * @param integer $projectId |
||
34 | * @param integer $campaignId |
||
35 | * @param boolean $includeClassic |
||
36 | * @param integer $page |
||
37 | * @param integer $perPage |
||
38 | * @return Result |
||
39 | * @throws Exception |
||
40 | */ |
||
41 | 1 | public function listAll($projectId, $campaignId=null, $includeClassic=false, $page=1, $perPage=25) |
|
66 | |||
67 | /** |
||
68 | * Get metadata for a single Experiment. |
||
69 | * @param integer $experimentId |
||
70 | * @return Result |
||
71 | * @throws Exception |
||
72 | */ |
||
73 | 1 | public function get($experimentId) |
|
87 | |||
88 | /** |
||
89 | * Get results for a single experiment |
||
90 | * @param integer $experimentId The id for the experiment you want results for |
||
91 | * @param integer $baselineVariationId The id of the variation to use as the baseline to compare against other variations. Defaults to the first variation if not provided. |
||
92 | * @param string $startTime The earliest time to count events in results. Defaults to the time that the experiment was first activated. |
||
93 | * @param string $endTime The latest time to count events in results. Defaults to the time the experiment was last active or the current time if the experiment is still running. |
||
94 | * @return Result |
||
95 | * @throws Exception |
||
96 | */ |
||
97 | 1 | public function getResults($experimentId, $baselineVariationId = null, $startTime = null, $endTime = null) |
|
116 | |||
117 | /** |
||
118 | * Create an experiment in a Project. |
||
119 | * @param Experiment $experiment |
||
120 | * @param boolean $publish Set to true to make the the experiment live to the world upon creation. |
||
121 | * @return Result |
||
122 | * @throw Exception |
||
123 | */ |
||
124 | 1 | public function create($experiment, $publish) |
|
150 | |||
151 | /** |
||
152 | * Update an Experiment by ID |
||
153 | * @param integer $experimentId |
||
154 | * @param Experiment $experiment |
||
155 | * @param boolean $overrideChanges If there are draft changes already in the experiment, you can override those changes by providing this query parameter. |
||
156 | * @param boolean $publish Whether to publish the changes to the world. |
||
157 | * @return Result |
||
158 | * @throws Exception |
||
159 | */ |
||
160 | 1 | public function update($experimentId, $experiment, $overrideChanges, $publish) |
|
189 | |||
190 | /** |
||
191 | * Delete Experiment by ID |
||
192 | * @param integer $experimentId |
||
193 | * @return Result |
||
194 | * @throws Exception |
||
195 | */ |
||
196 | 1 | public function delete($experimentId) |
|
203 | } |
||
204 | |||
205 |