<?php

/**
 * This is the model class for table "estatus".
 *
 * The followings are the available columns in table 'estatus':
 * @property integer $id_estatus
 * @property string $descripcion
 * @property string $borrado
 */
class Estatus extends CActiveRecord
{
	
	public function tableName()
	{
		return 'estatus';
	}

	public function rules()
	{
		
		return array(
			array('descripcion', 'required'),
			array('descripcion', 'length', 'max'=>100),
			array('borrado', 'length', 'max'=>1),
			// The following rule is used by search().
			// @todo Please remove those attributes that should not be searched.
			array('id_estatus, descripcion, borrado', 'safe', 'on'=>'search'),
		);
	}

	
	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(
		);
	}


	public function attributeLabels()
	{
		return array(
			'id_estatus' => 'Id Estatus',
			'descripcion' => 'Descripcion',
			'borrado' => 'Borrado',
		);
	}


	public function search()
	{
		// @todo Please modify the following code to remove attributes that should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('id_estatus',$this->id_estatus);
		$criteria->compare('descripcion',$this->descripcion,true);
		$criteria->compare('borrado',$this->borrado,true);

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


	public static function model($className=__CLASS__)
	{
		return parent::model($className);
	}
}
