Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
portfolio_format_leap2a_writer Class Reference

Object to encapsulate the writing of leap2a. More...

Public Member Functions

 __construct (stdclass $user)
 Constructor - usually generated from portfolio_format_leap2a\leap2a_writer($USER);.
 
 add_entry (portfolio_format_leap2a_entry $entry)
 Adds a entry to the feed ready to be exported.
 
 link_files ($entry, $files)
 Helper function to link some stored_files into the feed and link them to a particular entry.
 
 make_selection ($selectionentry, $ids, $selectiontype)
 Select an entry that has previously been added into the feed.
 
 to_xml ()
 Return the entire feed as a string.
 

Detailed Description

Object to encapsulate the writing of leap2a.

Should be used like: $writer = portfolio_format_leap2a\leap2a_writer($USER); $entry = new portfolio_format_leap2a_entry('forumpost6', $title, 'leap2', 'somecontent') $entry->add_link('something', 'has_part')->add_link('somethingelse', 'has_part'); .. etc $writer->add_entry($entry); $xmlstr = $writer->to_xml();

Todo
MDL-31287 - find a way to ensure that all referenced files are included
License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

portfolio_format_leap2a_writer::__construct ( stdclass $user)

Constructor - usually generated from portfolio_format_leap2a\leap2a_writer($USER);.

Todo
MDL-31302 - add exporter and format
Parameters
stdclass$userthe user exporting (almost always $USER)

Member Function Documentation

◆ add_entry()

portfolio_format_leap2a_writer::add_entry ( portfolio_format_leap2a_entry $entry)

Adds a entry to the feed ready to be exported.

Parameters
portfolio_format_leap2a_entry$entrynew feed entry to add
Return values
portfolio_format_leap2a_entry

◆ link_files()

portfolio_format_leap2a_writer::link_files ( $entry,
$files )

Helper function to link some stored_files into the feed and link them to a particular entry.

Parameters
portfolio_format_leap2a_entry$entryfeed object
array$filesarray of stored_files to link

◆ make_selection()

portfolio_format_leap2a_writer::make_selection ( $selectionentry,
$ids,
$selectiontype )

Select an entry that has previously been added into the feed.

Parameters
portfolio_format_leap2a_entry | string$selectionentrythe entry to make a selection (id or entry object)
array$idsarray of ids this selection includes
string$selectiontypefor selection type, see: http://wiki.cetis.ac.uk/2009-03/LEAP2A_categories/selection_type

◆ to_xml()

portfolio_format_leap2a_writer::to_xml ( )

Return the entire feed as a string.

Then, it calls for validation

Return values
stringfeeds' content in xml

The documentation for this class was generated from the following file: