You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
simple-yewu/common/models/FixMetalLevel.php

60 lines
1.2 KiB

5 years ago
<?php
namespace common\models;
use Yii;
/**
* This is the model class for table "fix_metal_level".
*
* @property integer $id
* @property string $name
* @property integer $level
* @property string $created_at
* @property string $updated_at
*/
class FixMetalLevel extends \common\models\Base
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'fix_metal_level';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['name', 'level'], 'required'],
[['level'], 'integer'],
[['created_at', 'updated_at'], 'safe'],
[['name'], 'string', 'max' => 5],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => 'ID',
'name' => 'Name',
'level' => 'Level',
'created_at' => 'Created At',
'updated_at' => 'Updated At',
];
}
public function getFixCarMetals(){
return $this->hasMany(FixCarMetal::className(),['level_id'=>'id']);
}
public function getProject(){
return $this->hasMany(FixCarProject::className(),['id'=>'project_id'])
->via('fixCarMetals');
}
}