BaseMzgttipospublicaciones.php 2.93 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81
<?php

/**
 * This is the model base class for the table "mzgttipospublicaciones".
 * DO NOT MODIFY THIS FILE! It is automatically generated by giix.
 * If any changes are necessary, you must set or override the required
 * property or method in class "Mzgttipospublicaciones".
 *
 * Columns in table "mzgttipospublicaciones" available as properties of the model,
 * followed by relations of table "mzgttipospublicaciones" available as properties of the model.
 *
 * @property integer $PK_MZGTTIPOSPUBLICACIONES
 * @property string $MZGTTIPOSPUBLICACIONES_DESCRIPCION
 * @property string $MZGTTIPOSPUBLICACIONES_CODIGO
 * @property integer $MZGTTIPOSPUBLICACIONES_ESTADO
 *
 * @property Mzgtpublicaciones[] $mzgtpublicaciones
 */
abstract class BaseMzgttipospublicaciones extends GxActiveRecord {

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

	public function tableName() {
		return 'mzgttipospublicaciones';
	}

	public static function label($n = 1) {
		return Yii::t('app', 'Mzgttipospublicaciones|Mzgttipospublicaciones', $n);
	}

	public static function representingColumn() {
		return 'MZGTTIPOSPUBLICACIONES_DESCRIPCION';
	}

	public function rules() {
		return array(
			array('MZGTTIPOSPUBLICACIONES_ESTADO', 'required'),
			array('MZGTTIPOSPUBLICACIONES_ESTADO', 'numerical', 'integerOnly'=>true),
			array('MZGTTIPOSPUBLICACIONES_DESCRIPCION', 'length', 'max'=>255),
			array('MZGTTIPOSPUBLICACIONES_CODIGO', 'length', 'max'=>50),
			array('MZGTTIPOSPUBLICACIONES_DESCRIPCION, MZGTTIPOSPUBLICACIONES_CODIGO', 'default', 'setOnEmpty' => true, 'value' => null),
			array('PK_MZGTTIPOSPUBLICACIONES, MZGTTIPOSPUBLICACIONES_DESCRIPCION, MZGTTIPOSPUBLICACIONES_CODIGO, MZGTTIPOSPUBLICACIONES_ESTADO', 'safe', 'on'=>'search'),
		);
	}

	public function relations() {
		return array(
			'mzgtpublicaciones' => array(self::HAS_MANY, 'Mzgtpublicaciones', 'FK4_MZGTPUBLICACIONES_INV_MZGTTIPOSPUBLICACIONES_PK'),
		);
	}

	public function pivotModels() {
		return array(
		);
	}

	public function attributeLabels() {
		return array(
			'PK_MZGTTIPOSPUBLICACIONES' => Yii::t('app', 'Pk Mzgttipospublicaciones'),
			'MZGTTIPOSPUBLICACIONES_DESCRIPCION' => Yii::t('app', 'Mzgttipospublicaciones Descripcion'),
			'MZGTTIPOSPUBLICACIONES_CODIGO' => Yii::t('app', 'Mzgttipospublicaciones Codigo'),
			'MZGTTIPOSPUBLICACIONES_ESTADO' => Yii::t('app', 'Mzgttipospublicaciones Estado'),
			'mzgtpublicaciones' => null,
		);
	}

	public function search() {
		$criteria = new CDbCriteria;

		$criteria->compare('PK_MZGTTIPOSPUBLICACIONES', $this->PK_MZGTTIPOSPUBLICACIONES);
		$criteria->compare('MZGTTIPOSPUBLICACIONES_DESCRIPCION', $this->MZGTTIPOSPUBLICACIONES_DESCRIPCION, true);
		$criteria->compare('MZGTTIPOSPUBLICACIONES_CODIGO', $this->MZGTTIPOSPUBLICACIONES_CODIGO, true);
		$criteria->compare('MZGTTIPOSPUBLICACIONES_ESTADO', $this->MZGTTIPOSPUBLICACIONES_ESTADO);

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