ZF-2102: Add ability to set the class used for statement objects (Zend_Db_Adapter_Pdo_Abstract/Zend_Db_Statement_Pdo)

Issue Type: Improvement Created: 2007-10-26T08:37:36.000+0000 Last Updated: 2008-09-02T10:39:19.000+0000 Status: Resolved Fix version(s): - 1.6.0 (02/Sep/08)

Reporter: Jack Sleight (jacksleight) Assignee: Simon Mundy (peptolab) Tags: - Zend_Db

Related issues: Attachments:


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?


Posted by Darby Felton (darby) on 2007-11-07T13:43:44.000+0000

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?

Posted by Jack Sleight (jacksleight) on 2007-11-07T13:51:15.000+0000

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.

Posted by Darby Felton (darby) on 2007-11-07T13:58:51.000+0000

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.

Posted by Wil Sinclair (wil) on 2008-03-21T17:05:29.000+0000

This issue should have been fixed for the 1.5 release.

Posted by Wil Sinclair (wil) on 2008-03-25T20:43:59.000+0000

Please categorize/fix as needed.

Posted by Wil Sinclair (wil) on 2008-04-18T13:12:06.000+0000

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

Posted by Simon Mundy (peptolab) on 2008-05-30T18:53:03.000+0000

Resolved in r9577

Posted by Wil Sinclair (wil) on 2008-09-02T10:39:19.000+0000

Updating for the 1.6.0 release.

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.