true), array('nombre', 'length', 'max'=>150), array('foto', 'length', 'max'=>255), array('descripcion, r_jrc, r_noindexada, congresos, capitulos_libro, patentes, proyectos_act, info_int, descargas, estudios, distinciones, info_cont, log', 'safe'), // The following rule is used by search(). // Please remove those attributes that should not be searched. array('id, id_categoria, nombre, descripcion, foto, r_jrc, r_noindexada, congresos, capitulos_libro, patentes, proyectos_act, info_int, descargas, estudios, distinciones, info_cont, activo, log', '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( 'idCategoria' => array(self::BELONGS_TO, 'CategoriasInt', 'id_categoria'), ); } /** * @return array customized attribute labels (name=>label) */ public function attributeLabels() { return array( 'id' => 'ID', 'id_categoria' => 'Categoría', 'nombre' => 'Nombre', 'descripcion' => 'Descripción', 'foto' => 'Foto', 'r_jrc' => 'Revistas Científicas', 'r_noindexada' => 'Difusión', 'congresos' => 'Congresos', 'capitulos_libro' => 'Capitulos de Libro', 'patentes' => 'Patentes', 'proyectos_act' => 'Proyectos', 'info_int' => 'Tesistas', 'descargas' => 'Descargas', 'estudios' => 'Estudios', 'distinciones' => 'Distinciones', 'info_cont' => 'Información de Contacto', 'activo' => 'Activo', 'log' => 'Log', ); } /** * 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_categoria',$this->id_categoria); $criteria->compare('nombre',$this->nombre,true); $criteria->compare('descripcion',$this->descripcion,true); $criteria->compare('foto',$this->foto,true); $criteria->compare('r_jrc',$this->r_jrc,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_int',$this->info_int,true); $criteria->compare('descargas',$this->descargas,true); $criteria->compare('estudios',$this->estudios,true); $criteria->compare('distinciones',$this->distinciones,true); $criteria->compare('info_cont',$this->info_cont,true); $criteria->compare('activo',$this->activo); $criteria->compare('log',$this->log,true); return new CActiveDataProvider($this, array( 'criteria'=>$criteria, )); } }