Geekzone: technology news, blogs, forums
Guest
Welcome Guest.
You haven't logged in yet. If you don't have an account you can register now.




1815 posts

Uber Geek
+1 received by user: 51

Trusted

Topic # 48549 16-Nov-2009 00:12
Send private message

I'm trying to learn PHP and have been struggling with working with objects.

I'm working with ZendFrame work and when I use gdata functions I get objects returned.

I would like to profile these objects, which usually contain more sub object and display it.

Does this make sense to anyone.  Not know the language makes it hard to explain what I'm trying todo.

I wonder should I hire a programmer to write/explain the process?  How much would it cost to hire a programmer for this?

Create new topic
I'm @nate
6287 posts

Uber Geek
+1 received by user: 373

Moderator
Trusted
Subscriber

  Reply # 273393 16-Nov-2009 09:14
Send private message

hellonearthisman:
I'm working with ZendFrame work and when I use gdata functions I get objects returned.


By GData I assume you mean this, does the support site not have enough info to get you started?






1815 posts

Uber Geek
+1 received by user: 51

Trusted

  Reply # 273469 16-Nov-2009 12:06
Send private message

The Zend site is good but it doesn't go into details to help me understand what's going on.


$query = new Zend_Gdata_Spreadsheets_DocumentQuery();
$query->setSpreadsheetKey($spreadsheetKey);
$feed = $spreadsheetService->getWorksheetFeed($query);

The resulting Zend_Gdata_Spreadsheets_WorksheetFeed object feed represents the response from the server. Among other things, this feed contains a list of Zend_Gdata_Spreadsheets_WorksheetEntry objects ($feed->entries), each of which represents a single worksheet.


I'm wanting to display the contents/details of objects like $feed.
var_dump and print_r don't seem to display the content fully, especially if the object contains sub objects.

 
 
 
 


I'm @nate
6287 posts

Uber Geek
+1 received by user: 373

Moderator
Trusted
Subscriber

  Reply # 273499 16-Nov-2009 13:48
Send private message

Could you loop through $feed->entries() and do a print_r() on each iteration, or alternatively, do print_r($feed->entries(0)) (I'm assuming that method supports numerical indexes) ?






1815 posts

Uber Geek
+1 received by user: 51

Trusted

  Reply # 278900 2-Dec-2009 23:41
Send private message

I do the print_r and it displays a ton of information but I'm not sure this is what I need?
Sorry to be confusing. The line $tetitle = $entry->title->text;

Is there a way to find these title->text names within an object.

$feed = $spreadsheetService->getSpreadsheetFeed();
foreach($feed->entries as $entry) { // All you spreadsheet files
  print_r($entry);
  $tetitle = $entry->title->text; // grab the title of the spread sheet
}


I'm @nate
6287 posts

Uber Geek
+1 received by user: 373

Moderator
Trusted
Subscriber

  Reply # 279060 3-Dec-2009 15:33
Send private message

I don't think there is any quick way other than doing a print_r on the methods you do know, or seeing if there is an online outline of all the methods/properties.






1815 posts

Uber Geek
+1 received by user: 51

Trusted

  Reply # 279121 3-Dec-2009 19:50
Send private message

No wonder I have been finding it hard how to do it via reverse engineering.
The detailed document's seem undocumented.

print_r($feed->entry[0]); is a good starts as I can debug an entry.

Window doesn't present a very well structured print_r as line feeds/newline...


Go Hawks!
750 posts

Ultimate Geek
+1 received by user: 23

Trusted
Subscriber

  Reply # 279142 3-Dec-2009 20:41
Send private message

I've had a lot of luck getting detail such as this when combining the PHP server with the debug modules.

My setup has generally been a local PHP server with the debugger all installed within Eclipse (PDT). Of course, setting this up was a bit of a mission - I googled a lot and unfortunately didn't follow through with completing the documentation. I haven't used the debugger in quite a while (and have also had a server rebuild in the middle).

If I come across the documentation in the short term, I'll find a place to post it and put a link back here (no promises though!!!)

Just as an aside, I had a lot more luck setting up the Zend Debugger than I did working with XDebug.



1815 posts

Uber Geek
+1 received by user: 51

Trusted

  Reply # 279165 3-Dec-2009 21:39
Send private message

I have been using Netbeans but not worked out how to use a debugger, Zendframework doesn't have good support in Netbeans with is a bummer. I might have to try Eclipse again.

I am Setting up a virtual machine with http://www.zend.com/en/products/server-ce/index That should have ZendDebugger in it.

Oh I found this function that formats the print_r for html.
<code>
function print_r_html ($arr) {
        ?><pre><?
        print_r($arr);
        ?></pre><?
}
print_r_html($feed->entry[0]);
</code>

Create new topic



Twitter »

Follow us to receive Twitter updates when new discussions are posted in our forums:



Follow us to receive Twitter updates when news items and blogs are posted in our frontpage:



Follow us to receive Twitter updates when tech item prices are listed in our price comparison site:





News »

How Oppo shakes New Zealand’s phone market
Posted 22-Aug-2017 18:32


Recognition for top small business advisors
Posted 22-Aug-2017 17:23


OPPO R11 dual 20MP camera phone debuts in New Zealand
Posted 22-Aug-2017 15:45


Intel introduces new 8th Generation processors
Posted 21-Aug-2017 19:02


Trend Micro launches Home Network Security
Posted 21-Aug-2017 18:38


Avondale College students at top of Microsoft Office Specialist World Championship
Posted 21-Aug-2017 14:11


Garmin introduces inReach SE+ and inReach Explorer+
Posted 21-Aug-2017 14:05


Public Wi-Fi plus cloud file sharing
Posted 18-Aug-2017 11:20


D-Link NZ launches professional Wireless AC Wave 2 Access Point for businesses
Posted 17-Aug-2017 19:25


Garmin introduces the Rino 700 five-watt two-way handheld radio
Posted 17-Aug-2017 19:04


Garmin announces the Foretrex 601 and Foretrex 701 Ballistic Edition for outdoor and tactical use
Posted 17-Aug-2017 19:02


Brightstar announces new distribution partnership with Samsung Knox platform in Australia
Posted 17-Aug-2017 17:07


Free gig-enabled WiFi network extends across Dunedin
Posted 17-Aug-2017 17:04


Samsung expands with connect Gear S3 Frontier
Posted 17-Aug-2017 15:55


Fact-checking Southern Cross Next cable is fastest to USA
Posted 17-Aug-2017 13:57



Geekzone Live »

Try automatic live updates from Geekzone directly in your browser, without refreshing the page, with Geekzone Live now.



Are you subscribed to our RSS feed? You can download the latest headlines and summaries from our stories directly to your computer or smartphone by using a feed reader.

Alternatively, you can receive a daily email with Geekzone updates.