<?php

/**
 * This is the model class for table "{{integrantes_info}}".
 *
 * The followings are the available columns in table '{{integrantes_info}}':
 * @property integer $id
 * @property integer $id_integrante
 * @property string $r_jcr
 * @property string $r_noindexada
 * @property string $congresos
 * @property string $capitulos_libro
 * @property string $patentes
 * @property string $proyectos_act
 * @property string $info_interes
 * @property string $descargas
 * @property string $estudios
 * @property string $distinciones
 * @property string $info_contacto
 *
 * The followings are the available model relations:
 * @property Integrantes $idIntegrante
 */
class IntegrantesInfo extends CActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @param string $className active record class name.
	 * @return IntegrantesInfo the static model class
	 */
	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}

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

	/**
	 * @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('id_integrante', 'required'),
			array('id_integrante', 'numerical', 'integerOnly'=>true),
			array('r_jcr, r_noindexada, congresos, capitulos_libro, patentes, proyectos_act, info_interes, descargas, estudios, distinciones, info_contacto', 'safe'),
			// The following rule is used by search().
			// Please remove those attributes that should not be searched.
			array('id, id_integrante, r_jcr, r_noindexada, congresos, capitulos_libro, patentes, proyectos_act, info_interes, descargas, estudios, distinciones, info_contacto', '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(
			'idIntegrante' => array(self::BELONGS_TO, 'Integrantes', 'id_integrante'),
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'id' => 'ID',
			'id_integrante' => 'Integrante',
			'r_jcr' => 'Revistas Científicas',
			'r_noindexada' => 'Difusión',
			'congresos' => 'Congresos',
			'capitulos_libro' => 'Capitulos de Libro',
			'patentes' => 'Patentes',
			'proyectos_act' => 'Proyectos',
			'info_interes' => 'Tesistas',
			'descargas' => 'Descargas',
			'estudios' => 'Estudios',
			'distinciones' => 'Distinciones',
			'info_contacto' => 'Información de Contacto',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 * @return CActiveDataProvider the data provider that can return the models based on the search/filter conditions.
	 */
	public function search()
	{
		// Warning: Please modify the following code to remove attributes that
		// should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('id',$this->id);
		$criteria->compare('id_integrante',$this->id_integrante);
		$criteria->compare('r_jcr',$this->r_jcr,true);
		$criteria->compare('r_noindexada',$this->r_noindexada,true);
		$criteria->compare('congresos',$this->congresos,true);
		$criteria->compare('capitulos_libro',$this->capitulos_libro,true);
		$criteria->compare('patentes',$this->patentes,true);
		$criteria->compare('proyectos_act',$this->proyectos_act,true);
		$criteria->compare('info_interes',$this->info_interes,true);
		$criteria->compare('descargas',$this->descargas,true);
		$criteria->compare('estudios',$this->estudios,true);
		$criteria->compare('distinciones',$this->distinciones,true);
		$criteria->compare('info_contacto',$this->info_contacto,true);

		return new CActiveDataProvider($this, array(
			'criteria'=>$criteria,
		));
	}
}