LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 09-15-2011, 02:53 PM   #1
secretlydead
Member
 
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:
http://code.google.com/apis/adwords/...html#dateRange

And I want the type to be dateRange:
$selector2->dateRange...

Although I've tried a few different things, I can't figure out how to define max and min
http://code.google.com/apis/adwords/...DateRange.html
for that selector.
 
Old 09-15-2011, 04:50 PM   #2
MidSpeck
LQ Newbie
 
Registered: Jul 2009
Posts: 9

Rep: Reputation: 6
Question

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, 05:32 PM   #3
secretlydead
Member
 
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.
 
  


Reply


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 04:45 PM
PHP OOP... where does the code go? eco Programming 2 01-12-2009 08:38 AM
PHP: why OOP over normal functions? konqi Programming 15 05-10-2008 08:10 PM
Does OOP make PHP slower? simopal6 Programming 2 04-20-2007 10:13 PM
OOP in PHP patpawlowski Programming 5 11-20-2005 04:37 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 08:13 PM.

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