original_string: public function add_entry(portfolio_format_leap2a_entry $entry) {
          if (array_key_exists($entry->id, $this->entries)) {
              if (!($entry instanceof portfolio_format_leap2a_file)) {
                  throw new portfolio_format_leap2a_exception('leap2a_entryalreadyexists', 'portfolio', '', $entry->id);
              }
          }
          $this->entries[$entry->id] =  $entry;
          return $entry;
      }
code: public function add_entry(portfolio_format_leap2a_entry $entry) {
          if (array_key_exists($entry->id, $this->entries)) {
              if (!($entry instanceof portfolio_format_leap2a_file)) {
                  throw new portfolio_format_leap2a_exception('leap2a_entryalreadyexists', 'portfolio', '', $entry->id);
              }
          }
          $this->entries[$entry->id] =  $entry;
          return $entry;
      }
code_tokens: public function add_entry ( portfolio_format_leap2a_entry $ entry ) { if ( array_key_exists ( $ entry -> id , $ this -> entries ) ) { if ( ! ( $ entry instanceof portfolio_format_leap2a_file ) ) { throw new portfolio_format_leap2a_exception ( 'leap2a_entryalreadyexists' , 'portfolio' , '' , $ entry -> id ) ; } } $ this -> entries [ $ entry -> id ] = $ entry ; return $ entry ; }
docstring: Adds a entry to the feed ready to be exported
  
  @param portfolio_format_leap2a_entry $entry new feed entry to add
  @return portfolio_format_leap2a_entry
docstring_tokens: Adds a entry to the feed ready to be exported