2010年7月29日星期四

[fw-gdata] Zend_Gdata_Entry not setting summary

I was trying to set a summary for a blog entry but it looks like it is stripped out or ignored when saved.

The api doc says that Zend_Gdata_Entry inherits from Zend_Gdata_App_Extensions_Entry and has a summary field that is set and gotten using get/setSummary()
and it excepts a Zend_Gdata_App_Extension_Summary() object.

When I do this I can see that it is set prior to saving but when i save and retrieve the entry the summary is not returned.

        $service = new Zend_Gdata($gauthNamespace->gauthClient);

        $query = new Zend_Gdata_Query('http://www.blogger.com/feeds/blogid/posts/default/postId');
        $entry = $service->getEntry($query);

        $summary = new Zend_Gdata_App_Extension_Summary();
        $summary->setText('testing summary');

        $entry->setSummary($summary);
        $entry->save();


Before the save the entry has the summary object
    [_summary:protected] => Zend_Gdata_App_Extension_Summary Object
(
[_rootElement:protected] => summary
[_type:protected] => text
[_rootNamespace:protected] => atom
[_rootNamespaceURI:protected] =>
[_extensionElements:protected] => Array
(
)

[_extensionAttributes:protected] => Array
(
)

[_text:protected] => testing summary
[_namespaces:protected] => Array
(
[atom] => Array
(
[1] => Array
(
[0] => http://www.w3.org/2005/Atom
)

)

[app] => Array
(
[1] => Array
(
[0] => http://purl.org/atom/app#
)

[2] => Array
(
[0] => http://www.w3.org/2007/app
)

)

)

)

When retrieved from google the summary is not sent in the post data.

 [_summary:protected] => 

Is there a way to set a summary in a blog entry?

没有评论: