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

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

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

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

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

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

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

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


wazzageek
1093 posts

Uber Geek

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.

 
 
 

Free kids accounts - trade shares and funds (NZ, US) with Sharesies (affiliate link).
hellonearthisman

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





News and reviews »

Air New Zealand Starts AI adoption with OpenAI
Posted 24-Jul-2025 16:00


eero Pro 7 Review
Posted 23-Jul-2025 12:07


BeeStation Plus Review
Posted 21-Jul-2025 14:21


eero Unveils New Wi-Fi 7 Products in New Zealand
Posted 21-Jul-2025 00:01


WiZ Introduces HDMI Sync Box and other Light Devices
Posted 20-Jul-2025 17:32


RedShield Enhances DDoS and Bot Attack Protection
Posted 20-Jul-2025 17:26


Seagate Ships 30TB Drives
Posted 17-Jul-2025 11:24


Oclean AirPump A10 Water Flosser Review
Posted 13-Jul-2025 11:05


Samsung Galaxy Z Fold7: Raising the Bar for Smartphones
Posted 10-Jul-2025 02:01


Samsung Galaxy Z Flip7 Brings New Edge-To-Edge FlexWindow
Posted 10-Jul-2025 02:01


Epson Launches New AM-C550Z WorkForce Enterprise printer
Posted 9-Jul-2025 18:22


Samsung Releases Smart Monitor M9
Posted 9-Jul-2025 17:46


Nearly Half of Older Kiwis Still Write their Passwords on Paper
Posted 9-Jul-2025 08:42


D-Link 4G+ Cat6 Wi-Fi 6 DWR-933M Mobile Hotspot Review
Posted 1-Jul-2025 11:34


Oppo A5 Series Launches With New Levels of Durability
Posted 30-Jun-2025 10:15









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.