Hi, 

I'm trying to migrate from the PHP API v201101 to v201109 and I realized 
that the *ReportDefinitionService *no longer has a mutate() method.
>From what I understand this should be replace using the *MutateJobService* 
>class 
but I'm having trouble understanding how that can be done considering the 
*ReportDefinitionOperation 
*class has been omitted from this version of the API.

Thanks

 

> $reportDefinitionService = $user->GetReportDefinitionService('v201109');
>
> $reportDefinition = new ReportDefinition();
>
> $reportDefinition->reportName = 'AD performance report #' .time();
>
> $reportDefinition->dateRangeType = 'LAST_30_DAYS';
>
> //****custom***
>
> $startDate = date("Ymd", strtotime("-1 days")); //-2
>
> $endDate = date("Ymd", strtotime("-1 days"));   //-1
>
> $selector->dateRange = new DateRange($startDate, $endDate);
>
> $reportDefinition->dateRangeType = "CUSTOM_DATE";
>
> //****end****
>
>  $reportDefinition->reportType = $reportType;
>
>  $reportDefinition->downloadFormat = 'CSV';
>>
>  $reportDefinition->selector = $selector;
>
>
>>  // Create operations.
>
>     $operation = new ReportDefinitionOperation(); 

 $operation->operand = $reportDefinition;
>
>  $operation->operator = 'ADD';
>
>
>>  $operations = array($operation);
>
>  $result = $reportDefinitionService->mutate($operations);
>
>  $array=array();
>
>  ini_set('memory_limit', '-1');
>
>  // Display report definitions.
>
> if ($result != null) {
>
>       foreach ($result as $reportDefinition) {
>
>            $csv = ReportUtils::DownloadReport($reportDefinition->id, 
>> $path= null, $user); 
>
>             $rows = explode( "\n", $csv );
>
>             for($i=2;$i<count($rows)-1;$i++)
>
>     {
>
> $array[]=explode( "\t" , $rows[$i] );
>
>     } 
>
>        }
>
>     } 

-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog and discussion group:
http://adwordsapi.blogspot.com
http://groups.google.com/group/adwords-api
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en

Reply via email to