original_string: protected function submitEditCollectionItem()
      {
          if ($this->isPosted('delete')) {
              $this->deleteCollectionItem();
          } else if ($this->isPosted('save') && $this->validateEditCollectionItem()) {
              if (isset($this->data_collection_item['collection_item_id'])) {
                  $this->updateCollectionItem();
              } else {
                  $this->addCollectionItem();
              }
          }
      }
code: protected function submitEditCollectionItem()
      {
          if ($this->isPosted('delete')) {
              $this->deleteCollectionItem();
          } else if ($this->isPosted('save') && $this->validateEditCollectionItem()) {
              if (isset($this->data_collection_item['collection_item_id'])) {
                  $this->updateCollectionItem();
              } else {
                  $this->addCollectionItem();
              }
          }
      }
code_tokens: protected function submitEditCollectionItem ( ) { if ( $ this -> isPosted ( 'delete' ) ) { $ this -> deleteCollectionItem ( ) ; } else if ( $ this -> isPosted ( 'save' ) && $ this -> validateEditCollectionItem ( ) ) { if ( isset ( $ this -> data_collection_item [ 'collection_item_id' ] ) ) { $ this -> updateCollectionItem ( ) ; } else { $ this -> addCollectionItem ( ) ; } } }
docstring: Saves a submitted collection item
docstring_tokens: Saves a submitted collection item