original_string: protected function submitEditProduct()
      {
          if ($this->isPosted('delete')) {
              $this->deleteProduct();
          } else if ($this->isPosted('save') && $this->validateEditProduct()) {
              $this->deleteImagesProduct();
              if (isset($this->data_product['product_id'])) {
                  $this->updateProduct();
              } else {
                  $this->addProduct();
              }
          }
      }
code: protected function submitEditProduct()
      {
          if ($this->isPosted('delete')) {
              $this->deleteProduct();
          } else if ($this->isPosted('save') && $this->validateEditProduct()) {
              $this->deleteImagesProduct();
              if (isset($this->data_product['product_id'])) {
                  $this->updateProduct();
              } else {
                  $this->addProduct();
              }
          }
      }
code_tokens: protected function submitEditProduct ( ) { if ( $ this -> isPosted ( 'delete' ) ) { $ this -> deleteProduct ( ) ; } else if ( $ this -> isPosted ( 'save' ) && $ this -> validateEditProduct ( ) ) { $ this -> deleteImagesProduct ( ) ; if ( isset ( $ this -> data_product [ 'product_id' ] ) ) { $ this -> updateProduct ( ) ; } else { $ this -> addProduct ( ) ; } } }
docstring: Handles a submitted product
docstring_tokens: Handles a submitted product