On 9/27/07, Trevor Johns <trevor@...> wrote:
On 2007-09-25 10:37:06 -0700, dmclark said:
> <strong>Title: </strong> <?php echo $event->title->text ?> <br />
> <strong>content: </strong> <?php echo $event->content ?> <br />
> <strong>when: </strong> <?php echo $event->when['startTime'] ?> <br />
Hi dmclark,
I think I might see your problem. Try $event->content->text and
$event->when->startTime.
I know it can be confusing at times. Unfortunately __toString() isn't
implemented consistently throughout the client library, which would
mitigate the simpler cases. This is a known issue (ZF-1632), and
something I'd very much like to see improved for future releases.
Not sure that toString solves this issue entirely though. It definitely works for things like atom:content (which is the confusing part here). We had some other ideas that we were floating around, and I thought I'd see what people think about it.
Right now, the data model closely resembles the XML. However, there are some XML elements used by GData services which only have a single attribute/child text node (or a single commonly-used attribute/child text node). See the class that represents gCal:selected, gCal:color, gCal:timezone for instance. Currently, to set one of these on an entry, the developer needs to actually create a new instance of the class and set the appropriate values. It would be easier if the client could just pass the appropriate text for an entry.
For example:
Instead of:
$entry->color = $gdata->newColor('orange')
We'd have:
$entry->colorValue = 'orange';
Similar things could hold true for title and content (though they each have more than one bit of data which needs to be set):
$entry->titleValue = 'foo'; (would automatically create a Zend_Gdata_App_Extension_Title object with the appropriate child text node.
The same thing would be used for retrieving data (though the toString solution solves this for newer versions of PHP):
print $entry->colorValue would traverse the Zend_Gdata_Calendar_Extension_Color object and grab the value of $_value
Thoughts?
-Ryan
:
$event->contentValue, $event->
--
Trevor Johns
http://tjohns.net