Zend framework fetchall

Is it possible to override the fetchall method in the model? I need to check every time fetchAll is called. The model extends Zend_db_table_abstract

+5
source share
2 answers

To override this method, you need to subclass Zend_Db_Table_Abstract. For example:

<?php
abstract class My_Db_Table_Abstract extends Zend_Db_Table_Abstract
{
    ...

    public function fetchAll($where, $order)
    {
        ...
    }

    ...
}

Then make sure your models extend My_Db_Table_Abstract. This way you always inherit your overridden fetchAll method.

+9
source

. fetchAll() , Zend_db_table_abstract (.. /), :

:: fetchAll ($ PARAMS)

0

All Articles