<?php

/**
 * This is the model class for table "sidcai_perfil_usuario".
 *
 * The followings are the available columns in table 'sidcai_perfil_usuario':
 * @property integer $usua_codigo_fk
 * @property integer $perf_codigo_fk
 */
class SidcaiPerfilUsuario extends CActiveRecord{
	public $tipo_acceso;

	/**
	 * @return string the associated database table name
	 */
	public function tableName(){
		return 'sidcai_perfil_usuario';
	}

	/**
	 * @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(
				'perf_codigo_fk',
				'safe',
				'on' => 'agregar'
			),
			array(
				'usua_codigo_fk, tipo_acceso', 
				'required', 
				'message' => 'Este campo es requerido',
				'on' => 'agregar'
			),
			array(
				'usua_codigo_fk', 
				'numerical', 
				'integerOnly' => true
			),
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels(){
		return array(
			'usua_codigo_fk' => 'Código Usuario',
			'perf_codigo_fk' => '',
			'tipo_acceso' => 'Tipo de acceso',
			'perfiles' => '',
		);
	}

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