private function editAction()
 {
     // no id => redirect home
     if (!array_key_exists('id', $_GET)) {
         $oProduct = new Product();
     } else {
         $iId = intval($_GET['id']);
         $oProduct = ProductManager::get($iId);
     }
     //  if (array_key_exists('addProduct', $_POST)) {
     if ($_SERVER['REQUEST_METHOD'] == 'POST') {
         $oProduct = new Product();
         $oProduct->setName($_POST['name']);
         $oProduct->setPrice($_POST['price']);
         $oProduct->setDescription($_POST['description']);
         if (array_key_exists('categories', $_POST)) {
             foreach ($_POST['categories'] as $iCategoryId) {
                 $oProduct->addCategory(CategoryManager::get($iCategoryId));
             }
         }
         if (array_key_exists('product-id', $_POST)) {
             // retourne Id du nouveau produit. Sinon null
             $iProductId = $_POST['product-id'];
             $oProduct->setId($iProductId);
             ProductManager::update($oProduct);
         } else {
             // retourne Id du nouveau produit créé. Sinon null
             $iProductId = ProductManager::create($oProduct);
             // Compléter l'objet par l'id du produit créé
             $oProduct->setId($iProductId);
         }
         if (!array_key_exists('image', $_POST)) {
             $temp = explode(".", $_FILES["image"]["name"]);
             $ext = $temp[count($temp) - 1];
             $newfilename = "images/product/" . $iProductId . '.' . $ext;
             $uploadfile = ROOT . $newfilename;
             move_uploaded_file($_FILES['image']['tmp_name'], $uploadfile);
             $oProduct->setImage($newfilename);
             ProductManager::update($oProduct);
         }
         $aComments = CommentManager::getAllFromProduct($oProduct);
         $aSimilarProducts = ProductManager::getRandom(5, 1);
         $aCategories = CategoryManager::getAll();
         require ROOT . 'src/ecommerce/view/product/show.php';
     } else {
         if (null === $oProduct) {
             $this->homeAction();
             return;
         }
         $aSimilarProducts = ProductManager::getRandom(5, 1);
         $aCategories = CategoryManager::getAll();
         require ROOT . 'src/ecommerce/view/product/edit.php';
     }
 }