<?php /** * This is the model base class for the table "mzgtcampus". * 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 "Mzgtcampus". * * Columns in table "mzgtcampus" available as properties of the model, * followed by relations of table "mzgtcampus" available as properties of the model. * * @property integer $PK_MZGTCAMPUS * @property string $MZGTCAMPUS_NOMBRE * @property string $MZGTCAMPUS_BANNER * @property integer $MZGTCAMPUS_ESTADO * * @property Mzgtdepartamentos[] $mzgtdepartamentoses */ abstract class BaseMzgtcampus extends GxActiveRecord { public static function model($className=__CLASS__) { return parent::model($className); } public function tableName() { return 'mzgtcampus'; } public static function label($n = 1) { return Yii::t('app', 'Mzgtcampus|Mzgtcampuses', $n); } public static function representingColumn() { return 'MZGTCAMPUS_NOMBRE'; } public function rules() { return array( array('MZGTCAMPUS_NOMBRE, MZGTCAMPUS_BANNER, MZGTCAMPUS_ESTADO', 'required'), array('MZGTCAMPUS_ESTADO', 'numerical', 'integerOnly'=>true), array('MZGTCAMPUS_NOMBRE', 'length', 'max'=>150), array('MZGTCAMPUS_BANNER', 'length', 'max'=>5), array('PK_MZGTCAMPUS, MZGTCAMPUS_NOMBRE, MZGTCAMPUS_BANNER, MZGTCAMPUS_ESTADO', 'safe', 'on'=>'search'), ); } public function relations() { return array( 'mzgtdepartamentoses' => array(self::MANY_MANY, 'Mzgtdepartamentos', 'mzgtcampus_departamentos(PK_MZGTCAMPUS, PK_MZGTDEPARTAMENTOS)'), ); } public function pivotModels() { return array( 'mzgtdepartamentoses' => 'MzgtcampusDepartamentos', ); } public function attributeLabels() { return array( 'PK_MZGTCAMPUS' => Yii::t('app', 'Pk Mzgtcampus'), 'MZGTCAMPUS_NOMBRE' => Yii::t('app', 'Mzgtcampus Nombre'), 'MZGTCAMPUS_BANNER' => Yii::t('app', 'Mzgtcampus Banner'), 'MZGTCAMPUS_ESTADO' => Yii::t('app', 'Mzgtcampus Estado'), 'mzgtdepartamentoses' => null, ); } public function search() { $criteria = new CDbCriteria; $criteria->compare('PK_MZGTCAMPUS', $this->PK_MZGTCAMPUS); $criteria->compare('MZGTCAMPUS_NOMBRE', $this->MZGTCAMPUS_NOMBRE, true); $criteria->compare('MZGTCAMPUS_BANNER', $this->MZGTCAMPUS_BANNER, true); $criteria->compare('MZGTCAMPUS_ESTADO', $this->MZGTCAMPUS_ESTADO); return new CActiveDataProvider($this, array( 'criteria' => $criteria, )); } }