<?php

class Corretor_Model_Processos extends Agro_Db_Table_Abstract {
	protected $_rowClass = 'Corretor_Model_Row_Processo';
	public $_order = 'dt_criacao desc';
	protected $_schema = 'sinistro';
	protected $_name = 'processos';
	protected $_primary = 'id';

    public function getData($where=false) {
        $select = $this->select()->setIntegrityCheck(false)->distinct();
        $select->from(array('v' => 'sinistro.v_processos_corretores'));
       
		if ($this->_order) {
            $select->order($this->_order);
        }

        $this->getWhere($select, $where);

        return $select;
    }
}