This repository has been archived by the owner on Jan 18, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Vikas Yadav
committed
Oct 11, 2017
1 parent
cd49714
commit 0319ad0
Showing
6 changed files
with
485 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
<?php | ||
|
||
/** | ||
* This is the model class for table "lb_block". | ||
* | ||
* The followings are the available columns in table 'lb_block': | ||
* @property integer $id_block | ||
* @property integer $id_district | ||
* @property string $name | ||
* @property string $updated | ||
*/ | ||
class Block extends CActiveRecord | ||
{ | ||
/** | ||
* @return string the associated database table name | ||
*/ | ||
public function tableName() | ||
{ | ||
return 'lb_block'; | ||
} | ||
|
||
/** | ||
* @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('id_district, name, updated', 'required'), | ||
array('id_district', 'numerical', 'integerOnly'=>true), | ||
array('name', 'length', 'max'=>70), | ||
// The following rule is used by search(). | ||
// @todo Please remove those attributes that should not be searched. | ||
array('id_block, id_district, name, updated', '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( | ||
'id_block' => 'Id Block', | ||
'id_district' => 'Id District', | ||
'name' => 'Name', | ||
'updated' => 'Updated', | ||
); | ||
} | ||
|
||
/** | ||
* 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('id_block',$this->id_block); | ||
$criteria->compare('id_district',$this->id_district); | ||
$criteria->compare('name',$this->name,true); | ||
$criteria->compare('updated',$this->updated,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 Block the static model class | ||
*/ | ||
public static function model($className=__CLASS__) | ||
{ | ||
return parent::model($className); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
<?php | ||
|
||
/** | ||
* This is the model class for table "lb_district". | ||
* | ||
* The followings are the available columns in table 'lb_district': | ||
* @property integer $id_district | ||
* @property string $name | ||
* @property string $updated | ||
* @property integer $id_state | ||
*/ | ||
class District extends CActiveRecord | ||
{ | ||
/** | ||
* @return string the associated database table name | ||
*/ | ||
public function tableName() | ||
{ | ||
return 'lb_district'; | ||
} | ||
|
||
public function behaviors() | ||
{ | ||
return [ | ||
'CTimestampBehavior' => array ( | ||
'class' => 'zii.behaviors.CTimestampBehavior', | ||
'createAttribute' => null, | ||
'updateAttribute' => 'updated', | ||
) | ||
]; | ||
} | ||
|
||
|
||
/** | ||
* @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('name, id_state', 'required'), | ||
array('id_state', 'numerical', 'integerOnly'=>true), | ||
array('name', 'length', 'max'=>255), | ||
// The following rule is used by search(). | ||
// @todo Please remove those attributes that should not be searched. | ||
array('id_district, name, updated, id_state', '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( | ||
'state' => array(self::BELONGS_TO, 'State', 'id_state'), | ||
); | ||
} | ||
|
||
/** | ||
* @return array customized attribute labels (name=>label) | ||
*/ | ||
public function attributeLabels() | ||
{ | ||
return array( | ||
'id_district' => 'Id District', | ||
'name' => 'Name', | ||
'updated' => 'Updated', | ||
'id_state' => 'Id State', | ||
); | ||
} | ||
|
||
/** | ||
* 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('id_district',$this->id_district); | ||
$criteria->compare('name',$this->name,true); | ||
$criteria->compare('updated',$this->updated,true); | ||
$criteria->compare('id_state',$this->id_state); | ||
|
||
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 District the static model class | ||
*/ | ||
public static function model($className=__CLASS__) | ||
{ | ||
return parent::model($className); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
<?php | ||
|
||
/** | ||
* This is the model class for table "lb_village". | ||
* | ||
* The followings are the available columns in table 'lb_village': | ||
* @property integer $id_village | ||
* @property integer $id_block | ||
* @property string $name | ||
* @property string $updated | ||
*/ | ||
class LBVillage extends CActiveRecord | ||
{ | ||
/** | ||
* @return string the associated database table name | ||
*/ | ||
public function tableName() | ||
{ | ||
return 'lb_village'; | ||
} | ||
|
||
/** | ||
* @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('id_block, name, updated', 'required'), | ||
array('id_block', 'numerical', 'integerOnly'=>true), | ||
array('name', 'length', 'max'=>255), | ||
// The following rule is used by search(). | ||
// @todo Please remove those attributes that should not be searched. | ||
array('id_village, id_block, name, updated', '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( | ||
'id_village' => 'Id Village', | ||
'id_block' => 'Id Block', | ||
'name' => 'Name', | ||
'updated' => 'Updated', | ||
); | ||
} | ||
|
||
/** | ||
* 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('id_village',$this->id_village); | ||
$criteria->compare('id_block',$this->id_block); | ||
$criteria->compare('name',$this->name,true); | ||
$criteria->compare('updated',$this->updated,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 LBVillage the static model class | ||
*/ | ||
public static function model($className=__CLASS__) | ||
{ | ||
return parent::model($className); | ||
} | ||
} |
Oops, something went wrong.