<?php

/**
 * This is the model class for table "sidcai_mensaje_analista_recaudo_rechazado".
 *
 * The followings are the available columns in table 'sidcai_mensaje_analista_recaudo_rechazado':
 * @property integer $mensa_codigo_pk
 * @property integer $usua_codigo_fk
 * @property integer $apor_codigo_fk
 * @property integer $decl_codigo_fk
 * @property string $mensa_contenido
 * @property string $mensa_fecha
 *
 * The followings are the available model relations:
 * @property SidcaiUsuario $usuaCodigoFk
 * @property SidcaiAportante $aporCodigoFk
 * @property SidcaiDeclaracioncti $declCodigoFk
 */
class SidcaiMensajeAnalistaRecaudoRechazado extends CActiveRecord{
	/**
	 * @return string the associated database table name
	 */
	public function tableName(){
		return 'sidcai_mensaje_analista_recaudo_rechazado';
	}

	/**
	 * @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('usua_codigo_fk, apor_codigo_fk, mensa_contenido, mensa_fecha', 'required'),
			array('usua_codigo_fk, apor_codigo_fk, decl_codigo_fk', 'numerical', 'integerOnly'=>true),
		);
	}

	/**
	 * @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(
			'usuaCodigoFk' => array(self::BELONGS_TO, 'SidcaiUsuario', 'usua_codigo_fk'),
			'aporCodigoFk' => array(self::BELONGS_TO, 'SidcaiAportante', 'apor_codigo_fk'),
			'declCodigoFk' => array(self::BELONGS_TO, 'SidcaiDeclaracioncti', 'decl_codigo_fk'),
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels(){
		return array(
			'mensa_codigo_pk' => 'Código',
			'usua_codigo_fk' => 'Usuario',
			'apor_codigo_fk' => 'Empresa',
			'decl_codigo_fk' => 'Declaración',
			'mensa_contenido' => 'Mensaje',
			'mensa_fecha' => 'Fecha',
		);
	}

	/**
	 * 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 SidcaiMensajeAnalistaRecaudoRechazado the static model class
	 */
	public static function model($className=__CLASS__){
		return parent::model($className);
	}
}
