public function actionDelete($id = null) { if ($id) { RealtyProperties::deleteAll(['id' => $id]); Yii::$app->getSession()->setFlash('success', 'Удалено'); } return $this->redirect(['index']); }
/** * @return \yii\db\ActiveQuery */ public function getRealtyProperties() { return $this->hasMany(RealtyProperties::className(), ['realty_property_types_id' => 'id']); }