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.


hellonearthisman

1819 posts

Uber Geek
+1 received by user: 52

Trusted

#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
nate
6473 posts

Uber Geek
+1 received by user: 458

Retired Mod
Trusted
Lifetime subscriber

  #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?



hellonearthisman

1819 posts

Uber Geek
+1 received by user: 52

Trusted

  #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.

nate
6473 posts

Uber Geek
+1 received by user: 458

Retired Mod
Trusted
Lifetime subscriber

  #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) ?



hellonearthisman

1819 posts

Uber Geek
+1 received by user: 52

Trusted

  #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
}


nate
6473 posts

Uber Geek
+1 received by user: 458

Retired Mod
Trusted
Lifetime subscriber

  #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.

hellonearthisman

1819 posts

Uber Geek
+1 received by user: 52

Trusted

  #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...


 
 
 

Shop now at Mighty Ape (affiliate link).
wazzageek
1095 posts

Uber Geek
+1 received by user: 108

ID Verified
Trusted
Lifetime subscriber

  #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.

hellonearthisman

1819 posts

Uber Geek
+1 received by user: 52

Trusted

  #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








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.