original_string: public function make_selection($selectionentry, $ids, $selectiontype) {
          $selectionid = null;
          if ($selectionentry instanceof portfolio_format_leap2a_entry) {
              $selectionid = $selectionentry->id;
          } else if (is_string($selectionentry)) {
              $selectionid = $selectionentry;
          }
          if (!array_key_exists($selectionid, $this->entries)) {
              throw new portfolio_format_leap2a_exception('leap2a_invalidentryid', 'portfolio', '', $selectionid);
          }
          foreach ($ids as $entryid) {
              if (!array_key_exists($entryid, $this->entries)) {
                  throw new portfolio_format_leap2a_exception('leap2a_invalidentryid', 'portfolio', '', $entryid);
              }
              $this->entries[$selectionid]->add_link($entryid, 'has_part');
              $this->entries[$entryid]->add_link($selectionid, 'is_part_of');
          }
          $this->entries[$selectionid]->add_category($selectiontype, 'selection_type');
          if ($this->entries[$selectionid]->type != 'selection') {
              debugging(get_string('leap2a_overwritingselection', 'portfolio', $this->entries[$selectionid]->type));
              $this->entries[$selectionid]->type = 'selection';
          }
      }
code: public function make_selection($selectionentry, $ids, $selectiontype) {
          $selectionid = null;
          if ($selectionentry instanceof portfolio_format_leap2a_entry) {
              $selectionid = $selectionentry->id;
          } else if (is_string($selectionentry)) {
              $selectionid = $selectionentry;
          }
          if (!array_key_exists($selectionid, $this->entries)) {
              throw new portfolio_format_leap2a_exception('leap2a_invalidentryid', 'portfolio', '', $selectionid);
          }
          foreach ($ids as $entryid) {
              if (!array_key_exists($entryid, $this->entries)) {
                  throw new portfolio_format_leap2a_exception('leap2a_invalidentryid', 'portfolio', '', $entryid);
              }
              $this->entries[$selectionid]->add_link($entryid, 'has_part');
              $this->entries[$entryid]->add_link($selectionid, 'is_part_of');
          }
          $this->entries[$selectionid]->add_category($selectiontype, 'selection_type');
          if ($this->entries[$selectionid]->type != 'selection') {
              debugging(get_string('leap2a_overwritingselection', 'portfolio', $this->entries[$selectionid]->type));
              $this->entries[$selectionid]->type = 'selection';
          }
      }
code_tokens: public function make_selection ( $ selectionentry , $ ids , $ selectiontype ) { $ selectionid = null ; if ( $ selectionentry instanceof portfolio_format_leap2a_entry ) { $ selectionid = $ selectionentry -> id ; } else if ( is_string ( $ selectionentry ) ) { $ selectionid = $ selectionentry ; } if ( ! array_key_exists ( $ selectionid , $ this -> entries ) ) { throw new portfolio_format_leap2a_exception ( 'leap2a_invalidentryid' , 'portfolio' , '' , $ selectionid ) ; } foreach ( $ ids as $ entryid ) { if ( ! array_key_exists ( $ entryid , $ this -> entries ) ) { throw new portfolio_format_leap2a_exception ( 'leap2a_invalidentryid' , 'portfolio' , '' , $ entryid ) ; } $ this -> entries [ $ selectionid ] -> add_link ( $ entryid , 'has_part' ) ; $ this -> entries [ $ entryid ] -> add_link ( $ selectionid , 'is_part_of' ) ; } $ this -> entries [ $ selectionid ] -> add_category ( $ selectiontype , 'selection_type' ) ; if ( $ this -> entries [ $ selectionid ] -> type != 'selection' ) { debugging ( get_string ( 'leap2a_overwritingselection' , 'portfolio' , $ this -> entries [ $ selectionid ] -> type ) ) ; $ this -> entries [ $ selectionid ] -> type = 'selection' ; } }
docstring: Select an entry that has previously been added into the feed
  
  @param portfolio_format_leap2a_entry|string $selectionentry the entry to make a selection (id or entry object)
  @param array $ids array of ids this selection includes
  @param string $selectiontype for selection type, see: http://wiki.cetis.ac.uk/2009-03/LEAP2A_categories/selection_type
docstring_tokens: Select an entry that has previously been added into the feed