File: /home/safarimaris/home/safarimaris/common/models/DicMaterial.php
<?php
namespace common\models;
use Yii;
/**
* This is the model class for table "material".
*
* @property integer $id
* @property string $name
*
* @property EntityBoat[] $entityBoats
*/
class DicMaterial extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'dic_material';
}
/**
* @inheritdoc
*/
public function rules()
{
return [
[['name'], 'required'],
[['name'], 'string', 'max' => 255],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
return [
'id' => Yii::t('model', 'ID'),
'name' => Yii::t('model', 'Name'),
];
}
/**
* @return \yii\db\ActiveQuery
*/
public function getEntityBoats()
{
return $this->hasMany(EntityBoat::className(), ['materialId' => 'id']);
}
}