Moodle  2.2.1
http://www.collinsharper.com
portfolio_format_leap2a_entry Class Reference
Inheritance diagram for portfolio_format_leap2a_entry:

Public Member Functions

 __construct ($id, $title, $type, $content=null)
 __set ($field, $value)
 validate ()
 add_link ($otherentry, $reltype, $displayorder=null)
 add_category ($term, $scheme=null, $label=null)
 to_dom (DomDocument $dom, $feedauthor)

Data Fields

 $id
 $title
 $type
 $author
 $summary
 $content
 $updated
 $published
 $links = array()
 $attachments = array()

Protected Member Functions

 add_extra_links ()

Detailed Description

this class represents a single leap2a entry. you can create these directly and then add them to the main leap feed object

Definition at line 205 of file lib.php.


Constructor & Destructor Documentation

__construct ( id,
title,
type,
content = null 
)

constructor. All arguments are required (and will be validated) http://wiki.cetis.ac.uk/2009-03/LEAP2A_types

Parameters:
string$idunique id of this entry. could be something like forumpost6 for example. This must be unique to the entire feed.
string$titletitle of the entry. This is pure atom.
string$typethe leap type of this entry.
mixed$contentthe content of the entry. string (xhtml/html/text)

Definition at line 250 of file lib.php.

Here is the call graph for this function:


Member Function Documentation

__set ( field,
value 
)

override __set to do proper dispatching for different things only allows the optional and required leap2a entry fields to be set

Definition at line 262 of file lib.php.

Here is the caller graph for this function:

add_category ( term,
scheme = null,
label = null 
)

add a category to this entry http://wiki.cetis.ac.uk/2009-03/LEAP2A_categories

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

"tags" should just pass a term here and no scheme or label. they will be automatically normalised if they have spaces.

Definition at line 334 of file lib.php.

Here is the caller graph for this function:

add_extra_links ( ) [protected]

hook function for subclasses to add extra links (like for files)

Definition at line 460 of file lib.php.

Here is the caller graph for this function:

add_link ( otherentry,
reltype,
displayorder = null 
)

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 http://wiki.cetis.ac.uk/2009-03/LEAP2A_relationships

Parameters:
mixed$otherentryportfolio_format_leap2a_entry or its id
string$reltype(no leap2: ns required)
Returns:
the current entry object. This is so that these calls can be chained eg $entry->add_link('something6', 'has_part')->add_link('something7', 'has_part');

Definition at line 306 of file lib.php.

to_dom ( DomDocument $  dom,
feedauthor 
)

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
Returns:
DomElement

Definition at line 357 of file lib.php.

Here is the call graph for this function:

validate ( )

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

Definition at line 279 of file lib.php.


Field Documentation

$attachments = array()

attachments to this entry

Definition at line 234 of file lib.php.

$author

optional author (only if different to feed author)

Definition at line 214 of file lib.php.

$content

main content of the entry. can be html,text,or xhtml. for a stored_file, use portfolio_format_leap2a_file

Definition at line 218 of file lib.php.

$id

entry id - something like forumpost6, must be unique to the feed

Definition at line 208 of file lib.php.

$links = array()

links from this entry to other entries

Definition at line 231 of file lib.php.

$published

published date (ctime) - unix timestamp

Definition at line 222 of file lib.php.

summary - for split long content

Definition at line 216 of file lib.php.

$title

title of the entry

Definition at line 210 of file lib.php.

$type

leap2a entry type

Definition at line 212 of file lib.php.

$updated

updated date - unix timestamp

Definition at line 220 of file lib.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations