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

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.

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...

Patch sent to [~jhartmann] for review:

http://codereview.appspot.com/20052

Since this is just a doc issue, I'm lowering the priority to trivial.

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