<?php

/**
 * This is the model class for table "sidcai_verificacion_pago".
 *
 * The followings are the available columns in table 'sidcai_verificacion_pago':
 * @property integer $veri_codigo_pk
 * @property string $veri_deta_declaraciones
 * @property string $veri_nuevo_monto
 * @property string $veri_fecha_pago
 * @property string $veri_referencia
 * @property boolean $veri_pago_aceptado
 */
class SidcaiVerificacionPago extends CActiveRecord
{
	/**
	 * @return string the associated database table name
	 */
	public function tableName()
	{
		return 'sidcai_verificacion_pago';
	}

	/**
	 * @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('veri_deta_declaraciones, veri_nuevo_monto, veri_fecha_pago, veri_referencia', 'required'),
			array('veri_deta_declaraciones', 'length', 'max'=>50),
			array('veri_nuevo_monto', 'length', 'max'=>20),
			array('veri_referencia', 'length', 'max'=>25),
			array('veri_pago_aceptado', 'safe'),
			// The following rule is used by search().
			// @todo Please remove those attributes that should not be searched.
			array('veri_codigo_pk, veri_deta_declaraciones, veri_nuevo_monto, veri_fecha_pago, veri_referencia, veri_pago_aceptado', '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(
		);
	}

	/**
	 * @return array customized attribute labels (name=>label)
	 */
	public function attributeLabels()
	{
		return array(
			'veri_codigo_pk' => 'Veri Codigo Pk',
			'veri_deta_declaraciones' => 'Veri Deta Declaraciones',
			'veri_nuevo_monto' => 'Veri Nuevo Monto',
			'veri_fecha_pago' => 'Veri Fecha Pago',
			'veri_referencia' => 'Veri Referencia',
			'veri_pago_aceptado' => 'Veri Pago Aceptado',
		);
	}

	/**
	 * Retrieves a list of models based on the current search/filter conditions.
	 *
	 * Typical usecase:
	 * - Initialize the model fields with values from filter form.
	 * - Execute this method to get CActiveDataProvider instance which will filter
	 * models according to data in model fields.
	 * - Pass data provider to CGridView, CListView or any similar widget.
	 *
	 * @return CActiveDataProvider the data provider that can return the models
	 * based on the search/filter conditions.
	 */
	public function search()
	{
		// @todo Please modify the following code to remove attributes that should not be searched.

		$criteria=new CDbCriteria;

		$criteria->compare('veri_codigo_pk',$this->veri_codigo_pk);
		$criteria->compare('veri_deta_declaraciones',$this->veri_deta_declaraciones,true);
		$criteria->compare('veri_nuevo_monto',$this->veri_nuevo_monto,true);
		$criteria->compare('veri_fecha_pago',$this->veri_fecha_pago,true);
		$criteria->compare('veri_referencia',$this->veri_referencia,true);
		$criteria->compare('veri_pago_aceptado',$this->veri_pago_aceptado);

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

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