Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8083037
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:19:44+00:00 2026-06-05T17:19:44+00:00

When I am callin fetchAll() on my DbTable I get results in proper DbRow

  • 0

When I am callin fetchAll() on my DbTable I get results in proper DbRow classes defined in DbTable.

But when I create custom query like this I get results in array. Is there any parameter that can force receiving this data ind DbRows or I should create rows by myself and populate them with those arrays?

$query = $this->_dbTable->getDefaultAdapter()->select()
        ->from('doctor.doctor')
        ->joinInner('facility.doctorfacility', 'facility.doctorfacility.doctor_id = doctor.doctor.id')
        ->joinInner('facility.facility', 'facility.doctorfacility.facility_id = facility.facility.id')
        ->where(implode(' AND ', $conds));

return $this->_dbTable->getDefaultAdapter()->fetchAll($query);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T17:19:46+00:00Added an answer on June 5, 2026 at 5:19 pm

    “But when I create custom query like this I get results in array”

    You are getting an array because you are calling Zend_Db_Adapter_Abstract::fetchAll() which according to the docblock in the code returns an array:-

    /**
     * Fetches all SQL result rows as a sequential array.
     * Uses the current fetchMode for the adapter.
     *
     * @param string|Zend_Db_Select $sql  An SQL SELECT statement.
     * @param mixed                 $bind Data to bind into SELECT placeholders.
     * @param mixed                 $fetchMode Override current fetch mode.
     * @return array
     */
    public function fetchAll($sql, $bind = array(), $fetchMode = null)
    

    “When I am callin fetchAll() on my DbTable I get results in proper DbRow classes defined in DbTable.”

    When you do this you are calling Zend_Db_Table_Abstract::fetchAll() which according to the docblock in the code returns a Zend_Db_Table_Rowset:-

    /**
     * Fetches all rows.
     *
     * Honors the Zend_Db_Adapter fetch mode.
     *
     * @param string|array|Zend_Db_Table_Select $where  OPTIONAL An SQL WHERE clause or Zend_Db_Table_Select object.
     * @param string|array                      $order  OPTIONAL An SQL ORDER clause.
     * @param int                               $count  OPTIONAL An SQL LIMIT count.
     * @param int                               $offset OPTIONAL An SQL LIMIT offset.
     * @return Zend_Db_Table_Rowset_Abstract The row results per the Zend_Db_Adapter fetch mode.
     */
    public function fetchAll($where = null, $order = null, $count = null, $offset = null)
    

    “Is there any parameter that can force receiving this data ind DbRows or I should create rows by myself and populate them with those arrays?”

    No there isn’t but if you call the correct method on the correct object you will get your rowsets returned.

    To do this change this line:-

    $query = $this->_dbTable->getDefaultAdapter()->select()
    

    To:-

    $query = $this->_dbTable->select()
    

    An this line:-

    return $this->_dbTable->getDefaultAdapter()->fetchAll($query);
    

    To:-

    return $this->_dbTable->fetchAll($query);
    

    That should get you what you need. It is always worthwhile looking at the code if you are stuck in ZF, it is by far the best documentation available.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write an iterator for results from a PDO statement but I
I'm selecting records from a database using the equivalent of this query: SELECT *
Calling this powershell command and getting an error. Driving me nuts. Prompt> get-childitem -recurse
Every now and then, I get into a situation when I have a query
Calling image = Image.open(data) image.thumbnail((36,36), Image.NEAREST) will maintain the aspect ratio. But I need
Calling the ajax called URL works well without ajax eg. http://localhost/ci/controller/method/param_value . But using
Calling getActionBar returns null . This has been frequently reported so I've made sure
Why calling a user defined function need the owner name when calling a stored
I'm trying to create a new instance of Setting object calling __construct() method with
I have the following function which enables a query to run with a where

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.