Пример #1
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getVehicle()
 {
     return $this->hasOne(Vehicle::className(), ['id' => 'vehicle_id']);
 }
Пример #2
0
 /**
  * Deletes an existing Vehicle model.
  * If deletion is successful, the browser will be redirected to the 'index' page.
  * @param integer $id
  * @return mixed
  */
 public function actionDelete($id)
 {
     $this->findModel(Vehicle::className(), $id)->delete();
     return $this->redirect(['index']);
 }