I'm hoping to find a more elegant solution to a problem I've already
solved sort of the hard way. I'm trying to get information from
public calendar feeds, including timezone and "where". My code
currently is:
$gdata = new Zend_Gdata();
$query= new Zend_Gdata_Query($args['gcalcalendarid']);
$feed = $gdata->getFeed($query);
$calendar['title'] = $feed->title->text;
$calendar['description'] = $feed->subtitle->text;
foreach ( $feed->extensionElements as $element )
{
if ($element->rootElement == 'timezone')
{
$calendar['timezone'] = $element->extensionAttributes['value']
['value'];
}
if ($element->rootElement == 'where')
{
$calendar['location'] = $element->extensionAttributes['valueString']
['value'];
}
}
return $calendar;
This definitely works, but there must be a better way to get at those
namespaced elements other than drilling down through object like
that. I haven't been able to find anything that works for me in the
documentation, though. Any thoughts?