<?php

/**
 * This is the model class for table "sidcai_declaracion_observacion".
 *
 * The followings are the available columns in table 'sidcai_declaracion_observacion':
 * @property integer $obse_codigo_pk
 * @property integer $usua_codigo_fk
 * @property integer $decl_codigo_fk
 * @property string $obse_fecha
 * @property string $obse_observacion
 * @property boolean $obse_habilitado
 *
 * The followings are the available model relations:
 * @property SidcaiUsuario $usuaCodigoFk
 * @property SidcaiDeclaracioncti $declCodigoFk
 */
class SidcaiDeclaracionObservacion extends CActiveRecord
{
	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'sidcai_declaracion_observacion';
	}

	/**
	 * @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, decl_codigo_fk, obse_fecha, obse_observacion', 'required'),
			array('usua_codigo_fk, decl_codigo_fk', 'numerical', 'integerOnly'=>true),
			array('obse_habilitado', 'safe'),
		);
	}

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

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'obse_codigo_pk' 	=> 'Código',
			'usua_codigo_fk' 	=> 'Usuario',
			'decl_codigo_fk' 	=> 'Declaración',
			'obse_fecha' 		=> 'Fecha',
			'obse_observacion' 	=> 'Observación',
			'obse_habilitado' 	=> 'Habilitado',
		);
	}


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