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

Common base class for submissions and example submissions rendering. More...

Inheritance diagram for workshop_submission_base:
workshop_example_submission_summary workshop_submission_summary workshop_example_submission workshop_submission

Public Member Functions

 __construct (workshop $workshop, stdClass $submission, $showauthor=false)
 Copies the properties of the given database record into properties of $this instance.
 
 anonymize ()
 Unsets all author-related properties so that the renderer does not have access to them.
 
 is_anonymous ()
 Does the submission object contain author-related information?
 

Protected Attributes

bool $anonymous
 is the submission anonymous (i.e.
 
array $fields = array()
 
workshop $workshop
 

Detailed Description

Common base class for submissions and example submissions rendering.

Subclasses of this class convert raw submission record from workshop_submissions table (as returned by {

See also
workshop\get_submission_by_id()} for example) into renderable objects.

Constructor & Destructor Documentation

◆ __construct()

workshop_submission_base::__construct ( workshop $workshop,
stdClass $submission,
$showauthor = false )

Copies the properties of the given database record into properties of $this instance.

Parameters
workshop$workshop
stdClass$submissionfull record
bool$showauthorshow the author-related information
array$optionsadditional properties

Member Function Documentation

◆ anonymize()

workshop_submission_base::anonymize ( )

Unsets all author-related properties so that the renderer does not have access to them.

Usually this is called by the contructor but can be called explicitely, too.

◆ is_anonymous()

workshop_submission_base::is_anonymous ( )

Does the submission object contain author-related information?

Return values
null|boolean

Reimplemented in workshop_example_submission_summary.

Member Data Documentation

◆ $anonymous

bool workshop_submission_base::$anonymous
protected

is the submission anonymous (i.e.

contains author information)


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