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.




1819 posts

Uber Geek

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
6361 posts

Uber Geek

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



1819 posts

Uber Geek

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.

 
 
 
 


6361 posts

Uber Geek

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



1819 posts

Uber Geek

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
}


6361 posts

Uber Geek

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



1819 posts

Uber Geek

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


Go Hawks!
956 posts

Ultimate Geek

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

 
 
 
 




1819 posts

Uber Geek

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



Twitter and LinkedIn »



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 »

Intel introduces cryogenic control chip to enable quantum computers
Posted 10-Dec-2019 21:32


Vodafone 5G service live in four cities
Posted 10-Dec-2019 08:30


Samsung Galaxy Fold now available in New Zealand
Posted 6-Dec-2019 00:01


NZ company oDocs awarded US$ 100,000 Dubai World Expo grant
Posted 5-Dec-2019 16:00


New Zealand Rugby Selects AWS-Powered Analytics for Deeper Game Insights
Posted 5-Dec-2019 11:33


IMAGR and Farro bring checkout-less supermarket shopping to New Zealand
Posted 5-Dec-2019 09:07


Wellington Airport becomes first 5G connected airport in the country
Posted 3-Dec-2019 08:42


MetService secures Al Jazeera as a new weather client
Posted 28-Nov-2019 09:40


NZ a top 10 connected nation with stage one of ultra-fast broadband roll-out completed
Posted 24-Nov-2019 14:15


Microsoft Translator understands te reo Māori
Posted 22-Nov-2019 08:46


Chorus to launch Hyperfibre service
Posted 18-Nov-2019 15:00


Microsoft launches first Experience Center worldwide for Asia Pacific in Singapore
Posted 13-Nov-2019 13:08


Disney+ comes to LG Smart TVs
Posted 13-Nov-2019 12:55


Spark launches new wireless broadband "Unplan Metro"
Posted 11-Nov-2019 08:19


Malwarebytes overhauls flagship product with new UI, faster engine and lighter footprint
Posted 6-Nov-2019 11:48



Geekzone Live »

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


Support Geekzone »

Our community of supporters help make Geekzone possible. Click the button below to join them.

Support Geezone on PressPatron



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.