Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 09-15-2011, 03:53 PM   #1
Registered: Sep 2003
Location: Qingdao, China
Distribution: mandriva, slack, red flag
Posts: 249

Rep: Reputation: 31
php oop - adwords api

I'm having a little difficulty reading an api manual and applying it to php.

I've made an object:
$selector2 = new Selector();

as defined by this page of the API:

And I want the type to be dateRange:

Although I've tried a few different things, I can't figure out how to define max and min
for that selector.
Old 09-15-2011, 05:50 PM   #2
LQ Newbie
Registered: Jul 2009
Posts: 9

Rep: Reputation: 6

I have never used the Adwords API, but maybe it would be something like:

$dateRange = new DateRange();
$dateRange->min = '20110701';
$dateRange->max = '20110731';

$selector2 = new Selector();
$selector2->dateRange = $dateRange;
Old 09-15-2011, 06:32 PM   #3
Registered: Sep 2003
Location: Qingdao, China
Distribution: mandriva, slack, red flag
Posts: 249

Original Poster
Rep: Reputation: 31
No, but you put me on the right track.

$selector->dateRange = new DateRange('20110101','20110105');

And for others looking for this answer, here's most the code:

$selector = new Selector();
$selector->fields = array('ExternalCustomerId', 'AccountDescriptiveName',
'PrimaryUserLogin', 'Date', 'Id', 'Name', 'Impressions', 'Clicks',
'Cost', 'AdNetworkType2');

// Create report definition.
$reportDefinition = new ReportDefinition();
$reportDefinition->reportName = 'dan_CrossClient-Complex-' . uniqid();

$reportDefinition->dateRangeType = 'CUSTOM_DATE';
$selector->dateRange = new DateRange('20110101','20110808');
$reportDefinition->reportType = 'CAMPAIGN_PERFORMANCE_REPORT';
$reportDefinition->downloadFormat = 'CSV';
$reportDefinition->selector = $selector;

If you have an EXPLANATION, just a little tidbit about OOP that it appears I don't know, I'd really appreciate it.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] OOP php - how to print object secretlydead Programming 2 09-13-2011 05:45 PM
PHP OOP... where does the code go? eco Programming 2 01-12-2009 09:38 AM
PHP: why OOP over normal functions? konqi Programming 15 05-10-2008 09:10 PM
Does OOP make PHP slower? simopal6 Programming 2 04-20-2007 11:13 PM
OOP in PHP patpawlowski Programming 5 11-20-2005 05:37 PM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:45 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration