예제 #1
0
                $reecriture->maj();
                $reecriture_new = new Reecriture();
                $reecriture_new->url = $reecriture->url;
                $reecriture_new->fond = 'nexisteplus';
                $reecriture_new->param = $reecriture->param . '&ancienfond=' . $reecriture->fond;
                $reecriture_new->actif = 1;
                $reecriture_new->lang = $reecriture->lang;
                $reecriture_new->add();
            }
            break;
        case 'dossier':
            preg_match("#id_dossier=([0-9]+)([^[0-9]])*#", $a->param, $match);
            $id = $match[1];
            $dossier = new Dossier();
            if (!$dossier->charger($id)) {
                $reecriture = new Reecriture();
                $reecriture->charger($a->url);
                $reecriture->actif = 0;
                $reecriture->maj();
                $reecriture_new = new Reecriture();
                $reecriture_new->url = $reecriture->url;
                $reecriture_new->fond = 'nexisteplus';
                $reecriture_new->param = $reecriture->param . '&ancienfond=' . $reecriture->fond;
                $reecriture_new->actif = 1;
                $reecriture_new->lang = $reecriture->lang;
                $reecriture_new->add();
            }
            break;
    }
}
/*fin gestion retroactivité des url reecrites des produits supprimés*/
 public function delete()
 {
     if ($reecriture = $this->charger_reecriture()) {
         $reecriture->actif = 0;
         $reecriture->maj();
         $reecriture_new = new Reecriture();
         $reecriture_new->url = $reecriture->url;
         $reecriture_new->fond = 'nexisteplus';
         $reecriture_new->param = $reecriture->param . '&ancienfond=' . $reecriture->fond;
         $reecriture_new->actif = 1;
         $reecriture_new->lang = $reecriture->lang;
         $reecriture_new->add();
     }
     parent::delete();
 }