<?php

/**
 * This is the model class for table "sidcai_declaracion_relacionada".
 *
 * The followings are the available columns in table 'sidcai_declaracion_relacionada':
 * @property integer $decl_codigo_fk
 * @property integer $decl_atrasada_fk
 *
 * The followings are the available model relations:
 * @property SidcaiDeclaracioncti $declCodigoFk
 * @property SidcaiDeclaracioncti $declAtrasadaFk
 */
class SidcaiDeclaracionRelacionada extends CActiveRecord{
	/**
	 * @return string the associated database table name
	 */
	public function tableName(){
		return 'sidcai_declaracion_relacionada';
	}

	/**
	 * @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, decl_atrasada_fk', 'required'),
			array('decl_codigo_fk, decl_atrasada_fk', 'numerical', 'integerOnly'=>true),
			// The following rule is used by search().
			// @todo Please remove those attributes that should not be searched.
			array('decl_codigo_fk, decl_atrasada_fk', 'safe', 'on'=>'search'),
		);
	}

	/**
	 * @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(
			'declCodigoFk' => array(self::BELONGS_TO, 'SidcaiDeclaracioncti', 'decl_codigo_fk'),
			'declAtrasadaFk' => array(self::BELONGS_TO, 'SidcaiDeclaracioncti', 'decl_atrasada_fk'),
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels(){
		return array(
			'decl_codigo_fk' => 'Decl Codigo Fk',
			'decl_atrasada_fk' => 'Decl Atrasada Fk',
		);
	}

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