コード例 #1
0
ファイル: DeathReason.php プロジェクト: Bochozkar/stat.ink
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getType()
 {
     return $this->hasOne(DeathReasonType::className(), ['id' => 'type_id']);
 }
コード例 #2
0
 public function rules()
 {
     return [[['type'], 'exist', 'targetClass' => DeathReasonType::className(), 'targetAttribute' => 'key']];
 }