PhpRiot
Follow phpriot on Twitter
Sponsored Link
Become Zend Certified

Prepare for the ZCE exam using our quizzes (web or iPad/iPhone). More info...


When you're ready get 7.5% off your exam voucher using voucher CJQNOV23 at the Zend Store
Free iPad/iPhone App
Available on the App Store

  • PHP manual
  • Zend Framework manual
  • Smarty manual
  • PHP articles
  • PHP training

Working with Data in Feeds and Entries

After retrieving a feed, you can read the data from the feed or the entries contained in the feed using either the accessors defined in each of the data model classes or the magic accessors. Here's an example:

<?php
$client 
Zend_Gdata_ClientLogin::getHttpClient($user$pass$service);
$gdata = new Zend_Gdata($client);
$query = new Zend_Gdata_Query(
        
'http://www.blogger.com/feeds/blogID/posts/default');
$query->setMaxResults(10);
$feed $gdata->getFeed($query);
foreach (
$feed as $entry) {
    
// using the magic accessor
    
echo 'Title: ' $entry->title->text;
    
// using the defined accessors
    
echo 'Content: ' $entry->getContent()->getText();
}

Zend Framework