original_string: protected function submitEditCategory()
      {
          if ($this->isPosted('delete')) {
              $this->deleteCategory();
          } else if ($this->isPosted('save') && $this->validateEditCategory()) {
              $this->deleteImagesCategory();
              if (isset($this->data_category['category_id'])) {
                  $this->updateCategory();
              } else {
                  $this->addCategory();
              }
          }
      }
code: protected function submitEditCategory()
      {
          if ($this->isPosted('delete')) {
              $this->deleteCategory();
          } else if ($this->isPosted('save') && $this->validateEditCategory()) {
              $this->deleteImagesCategory();
              if (isset($this->data_category['category_id'])) {
                  $this->updateCategory();
              } else {
                  $this->addCategory();
              }
          }
      }
code_tokens: protected function submitEditCategory ( ) { if ( $ this -> isPosted ( 'delete' ) ) { $ this -> deleteCategory ( ) ; } else if ( $ this -> isPosted ( 'save' ) && $ this -> validateEditCategory ( ) ) { $ this -> deleteImagesCategory ( ) ; if ( isset ( $ this -> data_category [ 'category_id' ] ) ) { $ this -> updateCategory ( ) ; } else { $ this -> addCategory ( ) ; } } }
docstring: Saves a submitted category
docstring_tokens: Saves a submitted category