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

Subclass of entry, purely for dealing with files. More...

Inheritance diagram for portfolio_format_leap2a_file:
portfolio_format_leap2a_entry

Public Member Functions

 __construct ($title, stored_file $file)
 Overridden constructor to set up the file.
 
 __set ($field, $value)
 Override __set to do proper dispatching for different things.
 
 add_category ($term, $scheme=null, $label=null)
 Add a category to this entry "tags" should just pass a term here and no scheme or label.
 
 add_link ($otherentry, $reltype, $displayorder=null)
 Add a link from this entry to another one.
 
 to_dom (DomDocument $dom, $feedauthor)
 Create an entry element and append all the children And return it rather than adding it to the dom.
 
 validate ()
 Validate this entry.
 

Public Attributes

array $attachments = array()
 attachments to this entry
 
string $author
 optional author (only if different to feed author)
 
mixed $content
 main content of the entry.
 
string $id
 entry id - something like forumpost6, must be unique to the feed
 
array $links = array()
 links from this entry to other entries
 
int $published
 published date (ctime) - unix timestamp
 
string $summary
 summary - for split long content
 
string $title
 title of the entry
 
string $type
 leap2a entry type
 
int $updated
 updated date - unix timestamp
 

Protected Member Functions

 add_extra_links ($dom, $entry)
 Implement the hook to add extra links to attach the file in an enclosure.
 

Protected Attributes

file_stored $referencedfile
 for the dealing file
 

Detailed Description

Subclass of entry, purely for dealing with files.

License
http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later

Constructor & Destructor Documentation

◆ __construct()

portfolio_format_leap2a_file::__construct ( $title,
stored_file $file )

Overridden constructor to set up the file.

Parameters
string$titletitle of the entry
stored_file$filefile storage instance

Member Function Documentation

◆ __set()

portfolio_format_leap2a_entry::__set ( $field,
$value )
inherited

Override __set to do proper dispatching for different things.

Only allows the optional and required leap2a entry fields to be set

Parameters
string$fieldproperty's name
mixed$valueproperty's value
Return values
mixed

◆ add_category()

portfolio_format_leap2a_entry::add_category ( $term,
$scheme = null,
$label = null )
inherited

Add a category to this entry "tags" should just pass a term here and no scheme or label.

They will be automatically normalised if they have spaces.

Parameters
string$termeg 'Offline'
string$scheme(optional) eg resource_type
string$label(optional) eg File

◆ add_extra_links()

portfolio_format_leap2a_file::add_extra_links ( $dom,
$entry )
protected

Implement the hook to add extra links to attach the file in an enclosure.

Parameters
DomDocument$domfeed object
DomDocument$entryfeed added link

Reimplemented from portfolio_format_leap2a_entry.

◆ add_link()

portfolio_format_leap2a_entry::add_link ( $otherentry,
$reltype,
$displayorder = null )
inherited

Add a link from this entry to another one.

These will be collated at the end of the export (during to_xml) and validated at that point. This function does no validation

Parameters
portfolio_format_leap2a_entry | string$otherentryportfolio_format_leap2a_entry or its id
string$reltype(no leap2: ns required)
string$displayorder(optional)
Return values
portfolio_format_leap2a_entrythe current entry object. This is so that these calls can be chained eg $entry->add_link('something6', 'has_part')->add_link('something7', 'has_part');

◆ to_dom()

portfolio_format_leap2a_entry::to_dom ( DomDocument $dom,
$feedauthor )
inherited

Create an entry element and append all the children And return it rather than adding it to the dom.

This is handled by the main writer object.

Parameters
DomDocument$domuse this to create elements
stdClass$feedauthorobject of author(user) info
Return values
DOMDocument

◆ validate()

portfolio_format_leap2a_entry::validate ( )
inherited

Validate this entry.

At the moment this just makes sure required fields exist but it could also check things against a list, for example

Todo
MDL-31303 - add category with a scheme 'selection_type'

Member Data Documentation

◆ $content

mixed portfolio_format_leap2a_entry::$content
inherited

main content of the entry.

can be html,text,or xhtml. for a stored_file, use portfolio_format_leap2a_file


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