FILTERS

Filters can be set for columns that will process (filter) the data before storing it to the database. Those filters are based on Zend_Filter, so you can use any Zend_Filter.

Simple Example:

<?php
class Example extends Kwf_Model_Db
{
    protected $_table = 'example';
    protected function _setupFilters()
    {
        parent::_setupFilters();
        $this->_filters['foo'] = new Zend_Filter_StringToLower();
    }
}
Koala Framework also comes with own filters:

Numberzize example:

<?php
class Example extends Kwf_Model_Db
{
    protected $_table = 'example';
    protected function _setupFilters()
    {
        parent::_setupFilters();
        $this->_filters['pos'] = new Kwf_Filter_Row_Numberize();
        $this->_filters['pos']->setGroupBy(array('category_id')); //group number sequence by this field
    }
}

There are also a few shortcuts how filters can be set:

 protected $_filters = 'filename'; //uses Kwf_Filter_Ascii by default
 protected $_filters = array('filename') //uses Kwf_Filter_Ascii by default
 protected $_filters = array('pos');      //uses Kwf_Filter_Row_Numberize by default
 protected $_filters = array('pos' => 'MyFilter') //creates MyFilter instance