public function actionDeleteBarcode($id_product, $barcode)
 {
     $child = ProductChild::findOne(['id_product' => $id_product, 'barcode' => $barcode]);
     $child->delete();
     Yii::$app->session->setFlash('_flash_action', 'barcode');
     return $this->redirect(['view', 'id' => $id_product]);
 }
Beispiel #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getBarcodes()
 {
     return $this->hasMany(ProductChild::className(), ['id_product' => 'id_product']);
 }