1
|
|
|
<?php |
2
|
|
|
namespace Werkspot\BingAdsApiBundle\Api\Report; |
3
|
|
|
|
4
|
|
|
use BingAds\Reporting\AccountThroughAdGroupReportScope; |
5
|
|
|
use BingAds\Reporting\GeoLocationPerformanceReportRequest; |
6
|
|
|
use BingAds\Reporting\NonHourlyReportAggregation; |
7
|
|
|
use BingAds\Reporting\ReportFormat; |
8
|
|
|
use BingAds\Reporting\ReportTime; |
9
|
|
|
|
10
|
|
|
class GeoLocationPerformanceReport extends BaseReport |
11
|
|
|
{ |
12
|
|
|
const NAME = 'GeoLocationPerformanceReportRequest'; |
13
|
|
|
|
14
|
|
|
/** |
15
|
|
|
* @var GeoLocationPerformanceReportRequest |
16
|
|
|
*/ |
17
|
|
|
protected $reportRequest; |
18
|
|
|
|
19
|
27 |
|
protected function createReportRequest() |
20
|
|
|
{ |
21
|
27 |
|
$this->reportRequest = new GeoLocationPerformanceReportRequest(); |
22
|
27 |
|
$this->reportRequest->Format = ReportFormat::Csv; |
23
|
27 |
|
$this->reportRequest->ReportName = self::NAME; |
24
|
27 |
|
$this->reportRequest->ReturnOnlyCompleteData = true; |
25
|
27 |
|
$this->reportRequest->Aggregation = NonHourlyReportAggregation::Daily; |
26
|
27 |
|
$this->reportRequest->Scope = new AccountThroughAdGroupReportScope(); |
27
|
27 |
|
$this->reportRequest->Time = new ReportTime(); |
28
|
27 |
|
} |
29
|
|
|
|
30
|
|
|
/** |
31
|
|
|
* @param string $aggregation (See BingAds SDK documentation) |
32
|
|
|
*/ |
33
|
1 |
|
public function setAggregation($aggregation) |
34
|
|
|
{ |
35
|
1 |
|
$this->reportRequest->Aggregation = $aggregation; |
36
|
1 |
|
} |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* @param array $columns |
40
|
|
|
*/ |
41
|
26 |
|
public function setColumns(array $columns) |
42
|
|
|
{ |
43
|
26 |
|
$this->reportRequest->Columns = $columns; |
44
|
26 |
|
} |
45
|
|
|
|
46
|
|
|
/** |
47
|
|
|
* @param string $timePeriod (See BingAds SDK documentation) |
48
|
|
|
*/ |
49
|
26 |
|
public function setTimePeriod($timePeriod) |
50
|
|
|
{ |
51
|
26 |
|
$this->reportRequest->Time->PredefinedTime = $timePeriod; |
|
|
|
|
52
|
26 |
|
} |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* {@inheritdoc} |
56
|
|
|
*/ |
57
|
26 |
|
public function getRequest() |
58
|
|
|
{ |
59
|
26 |
|
return $this->reportRequest; |
60
|
|
|
} |
61
|
|
|
} |
62
|
|
|
|
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..