|
Server IP : 127.0.0.1 / Your IP : 127.0.0.1 Web Server : Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.6.3 System : Windows NT WIN-R7LTCC7BPLI 6.3 build 9200 (Windows Server 2012 R2 Datacenter Edition) i586 User : GerbangSIPAD ( 0) PHP Version : 5.6.3 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF Directory (0777) : C:/xampp5/htdocs/bhumie/upload/../protected/models/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
/**
* This is the model class for table "pbb.ref_jns_sektor".
*
* The followings are the available columns in table 'pbb.ref_jns_sektor':
* @property string $kd_sektor
* @property string $nm_sektor
* @property integer $createdby
* @property string $createdtime
* @property integer $updatedby
* @property string $updatedtime
*
* The followings are the available model relations:
* @property CollectionRatio[] $collectionRatios
* @property Penerimaan[] $penerimaans
* @property RefKelurahan[] $refKelurahans
* @property Users $updatedby
* @property Users $createdby
* @property Prognosa[] $prognosas
* @property SimPbbSum[] $simPbbSums
* @property SimPotensiPenerimaan[] $simPotensiPenerimaans
* @property SimTarget[] $simTargets
*/
class RefJnsSektor extends CBhumieRecord
{
/**
* @return string the associated database table name
*/
public function tableName()
{
return 'pbb.ref_jns_sektor';
}
/**
* @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('kd_sektor', 'required'),
//array('createdby, updatedby', 'numerical', 'integerOnly'=>true),
array('kd_sektor', 'length', 'max'=>2),
array('nm_sektor', 'length', 'max'=>75),
// The following rule is used by search().
// @todo Please remove those attributes that should not be searched.
array('kd_sektor, nm_sektor, createdby, createdtime, updatedby, updatedtime', '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(
'collectionRatios' => array(self::HAS_MANY, 'CollectionRatio', 'kd_sektor'),
'penerimaans' => array(self::HAS_MANY, 'Penerimaan', 'kd_sektor'),
'refKelurahans' => array(self::HAS_MANY, 'RefKelurahan', 'kd_sektor'),
'updatedby' => array(self::BELONGS_TO, 'Users', 'updatedby'),
'createdby' => array(self::BELONGS_TO, 'Users', 'createdby'),
'prognosas' => array(self::HAS_MANY, 'Prognosa', 'kd_sektor'),
'simPbbSums' => array(self::HAS_MANY, 'SimPbbSum', 'kd_sektor'),
'simPotensiPenerimaans' => array(self::HAS_MANY, 'SimPotensiPenerimaan', 'kd_sektor'),
'simTargets' => array(self::HAS_MANY, 'SimTarget', 'kd_sektor'),
);
}
/**
* @return array customized attribute labels (name=>label)
*/
public function attributeLabels()
{
return array(
'kd_sektor' => 'Kd Sektor',
'nm_sektor' => 'Nm Sektor',
'createdby' => 'Createdby',
'createdtime' => 'Createdtime',
'updatedby' => 'Updatedby',
'updatedtime' => 'Updatedtime',
);
}
/**
* 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('kd_sektor',$this->kd_sektor,true);
$criteria->compare('nm_sektor',$this->nm_sektor,true);
$criteria->compare('createdby',$this->createdby);
$criteria->compare('createdtime',$this->createdtime,true);
$criteria->compare('updatedby',$this->updatedby);
$criteria->compare('updatedtime',$this->updatedtime,true);
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 RefJnsSektor the static model class
*/
public static function model($className=__CLASS__)
{
return parent::model($className);
}
}