<?php

/**
 * This is the model base class for the table "bancos".
 * DO NOT MODIFY THIS FILE! It is automatically generated by giix.
 * If any changes are necessary, you must set or override the required
 * property or method in class "Bancos".
 *
 * Columns in table "bancos" available as properties of the model,
 * and there are no model relations.
 *
 * @property integer $BAN_IDBANCO
 * @property string $BAN_DESCRICAO
 * @property integer $BAN_CODBAN
 * @property string $BAN_CEDENTE
 * @property string $BAN_AGENCIA
 * @property string $BAN_DVAGENCIA
 * @property string $BAN_CONTA
 * @property string $BAN_DVCONTA
 * @property integer $BAN_CARTEIRA
 * @property string $BAN_ACEITE
 * @property string $BAN_INSTRUCAO1
 * @property string $BAN_INSTRUCAO2
 * @property string $BAN_INSTRUCAO3
 * @property string $BAN_INSTRUCAO4
 * @property string $BAN_INSTRUCAO5
 * @property string $BAN_INSTRUCAO6
 * @property string $BAN_LOCALPAGTO
 * @property string $BAN_JUROS
 *
 */
class Bancos extends GxActiveRecord {

	public static function model($className=__CLASS__) {
		return parent::model($className);
	}

	public function tableName() {
		return 'bancos';
	}

	public static function label($n = 1) {
		return Yii::t('app', 'Banco|Bancos', $n);
	}

	public static function representingColumn() {
		return 'BAN_CEDENTE';
	}

	public function rules() {
		return array(
			array('BAN_CEDENTE', 'required'),
			array('BAN_CODBAN, BAN_CARTEIRA', 'numerical', 'integerOnly'=>true),
			array('BAN_DESCRICAO, BAN_CEDENTE', 'length', 'max'=>50),
			array('BAN_AGENCIA', 'length', 'max'=>7),
			array('BAN_DVAGENCIA, BAN_DVCONTA, BAN_ACEITE', 'length', 'max'=>1),
			array('BAN_CONTA', 'length', 'max'=>15),
			array('BAN_INSTRUCAO1, BAN_INSTRUCAO2, BAN_INSTRUCAO3, BAN_INSTRUCAO4, BAN_INSTRUCAO5, BAN_INSTRUCAO6', 'length', 'max'=>71),
			array('BAN_LOCALPAGTO', 'length', 'max'=>255),
			array('BAN_JUROS', 'length', 'max'=>10),
			array('BAN_DESCRICAO, BAN_CODBAN, BAN_AGENCIA, BAN_DVAGENCIA, BAN_CONTA, BAN_DVCONTA, BAN_CARTEIRA, BAN_ACEITE, BAN_INSTRUCAO1, BAN_INSTRUCAO2, BAN_INSTRUCAO3, BAN_INSTRUCAO4, BAN_INSTRUCAO5, BAN_INSTRUCAO6, BAN_LOCALPAGTO, BAN_JUROS', 'default', 'setOnEmpty' => true, 'value' => null),
			array('BAN_IDBANCO, BAN_DESCRICAO, BAN_CODBAN, BAN_CEDENTE, BAN_AGENCIA, BAN_DVAGENCIA, BAN_CONTA, BAN_DVCONTA, BAN_CARTEIRA, BAN_ACEITE, BAN_INSTRUCAO1, BAN_INSTRUCAO2, BAN_INSTRUCAO3, BAN_INSTRUCAO4, BAN_INSTRUCAO5, BAN_INSTRUCAO6, BAN_LOCALPAGTO, BAN_JUROS', 'safe', 'on'=>'search'),
			);
	}

	public function relations() {
		return array(
			);
	}

	public function pivotModels() {
		return array(
			);
	}

	public function attributeLabels() {
		return array(
			'BAN_IDBANCO' 		=> 'Ban Idbanco',
			'BAN_DESCRICAO' 	=> 'Ban Descricao',
			'BAN_CODBAN' 		=> 'Ban Codban',
			'BAN_CEDENTE' 		=> 'Ban Cedente',
			'BAN_AGENCIA' 		=> 'Ban Agencia',
			'BAN_DVAGENCIA' 	=> 'Ban Dvagencia',
			'BAN_CONTA' 		=> 'Ban Conta',
			'BAN_DVCONTA' 		=> 'Ban Dvconta',
			'BAN_CARTEIRA' 		=> 'Ban Carteira',
			'BAN_ACEITE' 		=> 'Ban Aceite',
			'BAN_INSTRUCAO1' 	=> 'Ban Instrucao1',
			'BAN_INSTRUCAO2' 	=> 'Ban Instrucao2',
			'BAN_INSTRUCAO3' 	=> 'Ban Instrucao3',
			'BAN_INSTRUCAO4' 	=> 'Ban Instrucao4',
			'BAN_INSTRUCAO5' 	=> 'Ban Instrucao5',
			'BAN_INSTRUCAO6' 	=> 'Ban Instrucao6',
			'BAN_LOCALPAGTO' 	=> 'Ban Localpagto',
			'BAN_JUROS' 		=> 'Ban Juros',
			);
	}

	public function search() {
		$criteria = new CDbCriteria;

		$criteria->compare('BAN_IDBANCO', $this->BAN_IDBANCO);
		$criteria->compare('BAN_DESCRICAO', $this->BAN_DESCRICAO, true);
		$criteria->compare('BAN_CODBAN', $this->BAN_CODBAN);
		$criteria->compare('BAN_CEDENTE', $this->BAN_CEDENTE, true);
		$criteria->compare('BAN_AGENCIA', $this->BAN_AGENCIA, true);
		$criteria->compare('BAN_DVAGENCIA', $this->BAN_DVAGENCIA, true);
		$criteria->compare('BAN_CONTA', $this->BAN_CONTA, true);
		$criteria->compare('BAN_DVCONTA', $this->BAN_DVCONTA, true);
		$criteria->compare('BAN_CARTEIRA', $this->BAN_CARTEIRA);
		$criteria->compare('BAN_ACEITE', $this->BAN_ACEITE, true);
		$criteria->compare('BAN_INSTRUCAO1', $this->BAN_INSTRUCAO1, true);
		$criteria->compare('BAN_INSTRUCAO2', $this->BAN_INSTRUCAO2, true);
		$criteria->compare('BAN_INSTRUCAO3', $this->BAN_INSTRUCAO3, true);
		$criteria->compare('BAN_INSTRUCAO4', $this->BAN_INSTRUCAO4, true);
		$criteria->compare('BAN_INSTRUCAO5', $this->BAN_INSTRUCAO5, true);
		$criteria->compare('BAN_INSTRUCAO6', $this->BAN_INSTRUCAO6, true);
		$criteria->compare('BAN_LOCALPAGTO', $this->BAN_LOCALPAGTO, true);
		$criteria->compare('BAN_JUROS', $this->BAN_JUROS, true);

		return new CActiveDataProvider($this, array(
			'criteria' => $criteria,
			'pagination' => array(    
				'pageSize' => 20,
				)
			)
		);
	}
}