<?php

/**
 * This is the model class for table "sidcai_multa_interes".
 *
 * The followings are the available columns in table 'sidcai_multa_interes':
 * @property integer $mult_codigo_pk
 * @property integer $decl_codigo_fk
 * @property string $mult_monto
 * @property integer $analista_fk
 * @property integer $audit_usua
 * @property integer $apor_codigo_fk
 * @property string $comprobante
 * @property string $mult_habilitada
 * @property string $multa_formal
 *
 * The followings are the available model relations:
 * @property SidcaiAportante $aporCodigoFk
 * @property SidcaiUsuario $usuaCodigoFk
 * @property SidcaiUsuario $analistaFk
 * @property SidcaiBanco $bancCodigoFk
 * @property SidcaiRechazarPago $rechCodigoFk
 */
class SidcaiMultaInteres extends CActiveRecord{
	/**
	 * @return string the associated database table name
	 */
	public function tableName(){
		return 'sidcai_multa_interes';
	}

	/**
	 * @return array validation rules for model attributes.
	 */
	public function rules(){
		// NOTE: you should only define rules for those attributes that
		// will receive user inputs.
		return array(
			array(
				'decl_codigo_fk, mult_monto, apor_codigo_fk, analista_fk', 
				'required',
				'message' => 'Este campo es requerido',
			),
			array(
				'mult_monto', 
				'filter',
				'filter' => 'trim',
			),
			array(
				'decl_codigo_fk, audit_usua, analista_fk', 
				'numerical', 
				'integerOnly' => true,
				'message' => 'Solo se permiten números.'
			),
			array('mult_monto', 'length', 'max'=>35),
		);
	}

	/**
	 * @return array relational rules.
	 */
	public function relations(){
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
			'aporCodigoFk' => array(self::BELONGS_TO, 'SidcaiAportante', 'apor_codigo_fk'),
			'analistaFk' => array(self::BELONGS_TO, 'SidcaiUsuario', 'analista_fk'),
			'declCodigoFk' => array(self::BELONGS_TO, 'SidcaiDeclaracioncti', 'decl_codigo_fk'),
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels(){
		return array(
			'mult_codigo_pk' 	 => 'Código',
			'decl_codigo_fk' 	 => 'Declaración',
			'mult_monto' 		 => 'Monto',
			'audit_usua' 		 => 'Usuario Auditor',
			'analista_fk' 		 => 'Analista',
			'mult_pago_aceptado' => 'Pago aceptado',
			'mult_habilitada'    => 'Habilitado',
			'multa_formal'    => 'Multa Formal',
		);
	}

	/**
	 * Returns the static model of the specified AR class.
	 * Please note that you should have this exact method in all your CActiveRecord descendants!
	 * @param string $className active record class name.
	 * @return SidcaiMultaInteres the static model class
	 */
	public static function model($className=__CLASS__){
		return parent::model($className);
	}
}
