Zend Framework

Zend_Application Db Resource - set fetch mode via config

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: N/A N/A
  • Resolution: Fixed
  • Affects Version/s: 1.8.0
  • Fix Version/s: 1.11.0
  • Component/s: Zend_Application, Zend_Db
  • Labels:
    None

Description

At the moment I have to do something like this to fetch objects rather than arrays from the database

protected function _initFetch(){

    $this->bootstrap('db');
    $db = $this->getResource('db');

    $db->setFetchMode(Zend_Db::FETCH_OBJ);

}

It would be great if the existing Db resource could take another config line like this

resources.db.fetchMode = 5

  1. ZF-6620.patch
    26/Sep/10 4:46 PM
    5 kB
    Ramon Henrique Ornelas
  2. ZF-6620v2.patch
    26/Sep/10 8:52 PM
    5 kB
    Ramon Henrique Ornelas

Activity

Hide
Clement Roux added a comment -
Show
Clement Roux added a comment - hi, try this patch : http://backfront.org/patch/zend_db-fetchmode-config.patch
Hide
Ramon Henrique Ornelas added a comment -

Improvement in patch and was added tests units.

Show
Ramon Henrique Ornelas added a comment - Improvement in patch and was added tests units.
Hide
Ramon Henrique Ornelas added a comment -

Patch v2 validation of fetch_mode supported by adapters.

Show
Ramon Henrique Ornelas added a comment - Patch v2 validation of fetch_mode supported by adapters.
Hide
Ramon Henrique Ornelas added a comment -

Fixed in trunk r23192, applied to release branch 1.11 r23193.

Show
Ramon Henrique Ornelas added a comment - Fixed in trunk r23192, applied to release branch 1.11 r23193.

People

Vote (3)
Watch (6)

Dates

  • Created:
    Updated:
    Resolved: