Zend: Select object: How do I replace the selected columns set by from()?

Viewed 7421

first of all, that's what I'm trying to do:

In one of my classes in the library I want to count the total amount of rows of a search result. The class uses a select object set by the appendant model of the search result. My problem is now, this select() has already set the requested columns by from(), but to simply count the rows I just want to select the id, because the website has to to be performant. I can't simply change the values of the object, because I'm using it in the library and the variables are protected. Unfortunately, Zend has no function for the mySql count command and I don't want to use static mySql code, because it could be, that we switch our database system in the future.

Now here's my question:

Is there any possibility by Zend_Select how I could change the selected columns?

4 Answers
Related