Gestione rimozione collegamento variante attributo

This commit is contained in:
MatteoPistorello 2021-12-15 11:59:32 +01:00
parent 5a86fb0336
commit 907dd8bf53
1 changed files with 3 additions and 0 deletions

View File

@ -44,10 +44,13 @@ class Combinazione extends Model
public function delete()
{
$database = database();
// Rimozione articoli collegati
$articoli = $this->articoli;
foreach ($articoli as $articolo) {
$articolo->delete();
$database->query('DELETE FROM mg_articolo_attributo WHERE id_articolo='.prepare($articolo['id']));
}
return parent::delete();