File: /home/safarimaris/home/safarimaris/common/models/DicFood.php
<?php
namespace common\models;
use Yii;
/**
* This is the model class for table "dic_food".
*
* @property integer $id
* @property string $name
*
* @property EntityBoatFoodLink[] $entityBoatFoodLinks
*/
class DicFood extends \yii\db\ActiveRecord
{
/**
* @inheritdoc
*/
public static function tableName()
{
return 'dic_food';
}
/**
* @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 getEntityBoatFoodLinks()
{
return $this->hasMany(EntityBoatFoodLink::className(), ['foodId' => 'id']);
}
}