Zend Framework

getTotalResults return object, not integer

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Trivial Trivial
  • Resolution: Fixed
  • Affects Version/s: 1.7.1
  • Fix Version/s: 1.8.1
  • Component/s: Zend_Gdata
  • Labels:
    None

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.

Activity

Hide
Satoru Yoshida added a comment -

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.

Show
Satoru Yoshida added a comment - 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.
Hide
Trevor Johns added a comment -

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

Show
Trevor Johns added a comment - 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...
Hide
Trevor Johns added a comment -
Show
Trevor Johns added a comment - Patch sent to Jochen Hartmann for review: http://codereview.appspot.com/20052
Hide
Trevor Johns added a comment -

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

Show
Trevor Johns added a comment - Since this is just a doc issue, I'm lowering the priority to trivial.
Hide
Trevor Johns added a comment -

Committed to trunk as r14614.
Committed to release-1.7 as r14615.
Marking as fixed for next mini release.

commit 359584d5b5858bc836b5c5f5bdfc6c326a51644c
Author: tjohns <tjohns@44c647ce-9c0f-0410-b52a-842ac1e357ba>
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/standard/trunk@14614 44c647ce-9c0f-0410-b52a-842ac1e357ba

commit a14fbc2302f7afab486e2acb3761668299fe9498
Author: tjohns <tjohns@44c647ce-9c0f-0410-b52a-842ac1e357ba>
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/standard/branches/release-1.7@14615 44c647ce-9c0f-0410-b52a-842ac1e357ba
Show
Trevor Johns added a comment - Committed to trunk as r14614. Committed to release-1.7 as r14615. Marking as fixed for next mini release.
commit 359584d5b5858bc836b5c5f5bdfc6c326a51644c
Author: tjohns <tjohns@44c647ce-9c0f-0410-b52a-842ac1e357ba>
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/standard/trunk@14614 44c647ce-9c0f-0410-b52a-842ac1e357ba

commit a14fbc2302f7afab486e2acb3761668299fe9498
Author: tjohns <tjohns@44c647ce-9c0f-0410-b52a-842ac1e357ba>
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/standard/branches/release-1.7@14615 44c647ce-9c0f-0410-b52a-842ac1e357ba

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: