ZF-5664: getTotalResults return object, not integer
Description
On a Gdata feed getTotalResults returns an object not an integer as the documentation suggests.
It is possible I am making an error of some sort, but this seems to be a pretty big problem.
Example code is as follows:
$resultsNum = $feed->getTotalResults(); echo gettype($resultNum);
This returns "object" rather than the expected "integer"
Thanks.
Comments
Posted by old of Satoru Yoshida (yoshida@zend.co.jp) on 2009-02-21T02:46:53.000+0000
I correct the component from Zend_Feed to Zend_Gdata and auto re-assign.
Because Zend_Gdata_Feed has this issue , not in Zend_Feed.
Posted by Trevor Johns (tjohns) on 2009-02-23T13:45:00.000+0000
This is a documentation bug. getTotalResults() is used to return the openSearch:totalResults element.
The code you want to use:
$resultsNumObj = $feed->getTotalResults(); $resultsNum = $resultsNumObj->getText(); echo gettype($resultNum);
I'll update the documentation...
Posted by Trevor Johns (tjohns) on 2009-02-23T13:53:01.000+0000
Patch sent to [~jhartmann] for review:
http://codereview.appspot.com/20052
Posted by Trevor Johns (tjohns) on 2009-02-26T17:11:45.000+0000
Since this is just a doc issue, I'm lowering the priority to trivial.
Posted by Trevor Johns (tjohns) on 2009-04-02T16:37:32.000+0000
Committed to trunk as r14614. Committed to release-1.7 as r14615. Marking as fixed for next mini release.
commit 359584d5b5858bc836b5c5f5bdfc6c326a51644c Author: tjohns Date: Thu Apr 2 23:28:37 2009 +0000 ZF-5664: Update Zend_Gdata_Feed documentation to indicate proper argument/return-value types on OpenSearch setters and getters. Review URL: http://codereview.appspot.com/20052 git-svn-id: http://framework.zend.com/svn/framework/… 44c647ce-9c0f-0410-b52a-842ac1e357ba commit a14fbc2302f7afab486e2acb3761668299fe9498 Author: tjohns Date: Thu Apr 2 23:33:39 2009 +0000 Merge r14614 from trunk to release-1.7. ZF-5664: Update Zend_Gdata_Feed documentation to indicate proper argument/return-value types on OpenSearch setters and getters. Review URL: http://codereview.appspot.com/20052 git-svn-id: http://framework.zend.com/svn/framework/… 44c647ce-9c0f-0410-b52a-842ac1e357ba