Moodle APIs 3.9
Moodle 3.9.13+ (Build: 20220325)
Public Member Functions | Protected Attributes | List of all members
core_availability\result Class Reference

Class represents the result of an availability check for the user. More...

Public Member Functions

 __construct ($available, tree_node $node=null, array $failedchildren=array())
 Constructs result. More...
 
 filter_nodes (array $array)
 Filters the provided array so that it only includes nodes which are supposed to be displayed in the result output. More...
 
 is_available ()
 Checks if the result was a yes. More...
 

Protected Attributes

bool $available
 True if the item is available.
 
tree_node[] $shownodes = array()
 Array of nodes to display in failure information (node=>node).
 

Detailed Description

Class represents the result of an availability check for the user.

You can pass an object of this class to tree::get_result_information to display suitable student information about the result.

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

Constructor & Destructor Documentation

◆ __construct()

core_availability\result::__construct (   $available,
tree_node  $node = null,
array  $failedchildren = array() 
)

Constructs result.

Parameters
bool$availableTrue if available
tree_node$nodeNode if failed & should be displayed
result[]$failedchildrenArray of children who failed too

Member Function Documentation

◆ filter_nodes()

core_availability\result::filter_nodes ( array  $array)

Filters the provided array so that it only includes nodes which are supposed to be displayed in the result output.

(I.e. those for which the user failed the test, and which are not set to totally hide output.)

Parameters
tree_node[]$arrayInput array of nodes
Return values
arrayOutput array containing only those nodes set for display

◆ is_available()

core_availability\result::is_available ( )

Checks if the result was a yes.

Return values
boolTrue if the activity is available

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