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;
    }