Zend Framework

Add ability to set the class used for statement objects (Zend_Db_Adapter_Pdo_Abstract/Zend_Db_Statement_Pdo)

Details

  • Type: Improvement Improvement
  • Status: Resolved Resolved
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 1.6.0
  • Component/s: Zend_Db
  • Labels:
    None
  • Fix Version Priority:
    Nice to Have

Description

When running a SELECT query through one of the PDO adapters a Zend_Db_Statement_Pdo object is returned. However if you were to extend Zend_Db_Statement_Pdo with your own class, there is presently no way tell Zend_Db_Adapter_Pdo_Abstract to use that class for new statement objects, as it is hard coded into Zend_Db_Adapter_Pdo_Abstract::prepare().

Could we add the facility to set the class used for new statement objects?

Activity

Hide
Darby Felton added a comment -

It seems as if you could simply extend the pdo adapter class with a class of your own, overriding the prepare() method, is this not the case, and if not, why?

Show
Darby Felton added a comment - It seems as if you could simply extend the pdo adapter class with a class of your own, overriding the prepare() method, is this not the case, and if not, why?
Hide
Jack Sleight added a comment -

Oh you can, and that's exactly what I've done for now. I just thought it would be beneficial to have a way to do it built right in, rather than have to extend the class yourself. Much like you can set the row class in Zend_Db_Table. This would be particularly useful if you needed to do it with more than one type of adapter.

Show
Jack Sleight added a comment - Oh you can, and that's exactly what I've done for now. I just thought it would be beneficial to have a way to do it built right in, rather than have to extend the class yourself. Much like you can set the row class in Zend_Db_Table. This would be particularly useful if you needed to do it with more than one type of adapter.
Hide
Darby Felton added a comment -

I agree that we should have such support without extending the class. I've lowered the priority to minor, however, since an easy workaround is available.

Show
Darby Felton added a comment - I agree that we should have such support without extending the class. I've lowered the priority to minor, however, since an easy workaround is available.
Hide
Wil Sinclair added a comment -

This issue should have been fixed for the 1.5 release.

Show
Wil Sinclair added a comment - This issue should have been fixed for the 1.5 release.
Hide
Wil Sinclair added a comment -

Please categorize/fix as needed.

Show
Wil Sinclair added a comment - Please categorize/fix as needed.
Hide
Wil Sinclair added a comment -

This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.

Show
Wil Sinclair added a comment - This doesn't appear to have been fixed in 1.5.0. Please update if this is not correct.
Hide
Simon Mundy added a comment -

Resolved in r9577

Show
Simon Mundy added a comment - Resolved in r9577
Hide
Wil Sinclair added a comment -

Updating for the 1.6.0 release.

Show
Wil Sinclair added a comment - Updating for the 1.6.0 release.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved:

Time Tracking

Estimated:
2h
Original Estimate - 2 hours Original Estimate - 2 hours
Remaining:
0m
Remaining Estimate - 0 minutes
Logged:
2h 30m
Time Spent - 2 hours, 30 minutes