public function getTypesPrice() { return $this->hasMany(SUnit::className(), ['id_category' => 'id']); }
public function actionDelVidPrice() { $post = Yii::$app->request->post(); $id_element = $post["id_element"]; $SUnit = SUnit::findOne($id_element); $parent_id = $SUnit->id_category; $SUnit->delete(); $this->redirect(['/cabinet/item', 'id' => $parent_id]); }
public function getUnit() { return $this->hasOne(SUnit::className(), ['id' => 'id_unit']); }
public function getTypesPrice() { return SUnit::find()->where(['id_category' => $this->id_category])->all(); }