| Current Path : /var/www/html/eform/frontend/models/ |
| Current File : /var/www/html/eform/frontend/models/Unit.php |
<?php
namespace frontend\models;
use Yii;
/**
* This is the model class for table "Unit".
*
* @property string $Code
* @property string|null $Name
*/
class Unit extends \yii\db\ActiveRecord
{
/**
* {@inheritdoc}
*/
public static function tableName()
{
return 'Unit';
}
/**
* @return \yii\db\Connection the database connection used by this AR class.
*/
public static function getDb()
{
return Yii::$app->get('bkrm');
}
/**
* {@inheritdoc}
*/
public function rules()
{
return [
[['Code'], 'required'],
[['Code'], 'string', 'max' => 10],
[['Name'], 'string', 'max' => 200],
[['Code'], 'unique'],
];
}
/**
* {@inheritdoc}
*/
public function attributeLabels()
{
return [
'Code' => 'Code',
'Name' => 'Name',
];
}
}