Moodle APIs
3.8
Moodle 3.8.6 (Build: 20201109)
|
Stores the information about the allocation process. More...
Public Member Functions | |
__construct (workshop_allocator $allocator) | |
Creates new instance of the object. More... | |
get_logs () | |
Returns list of logged messages. More... | |
get_message () | |
get_status () | |
get_timeend () | |
log ($message, $type='ok', $indent=0) | |
Appends a new message to the log. More... | |
set_status ($status, $message=null) | |
Sets the result status of the allocation. More... | |
Public Attributes | |
const | STATUS_CONFIGURED = 3 |
scheduled allocation was configured (to be executed later, for example) | |
const | STATUS_EXECUTED = 1 |
allocation was successfully executed | |
const | STATUS_FAILED = 2 |
a serious error has occurred during the allocation (as a hole) | |
const | STATUS_VOID = 0 |
the init() called successfully but no actual allocation was done | |
Protected Attributes | |
workshop_allocator | $allocator |
the instance of the allocator that produced this result | |
array | $logs = array() |
of log message objects, { More... | |
null string | $message = null |
optional result message to display | |
null int | $status = null |
the status of the init() call | |
int | $timeend = null |
the timestamp of when the final status was set | |
int | $timestart = null |
the timestamp of when the allocation process started | |
Stores the information about the allocation process.
Allocator's method init() returns instance of this class.
workshop_allocation_result::__construct | ( | workshop_allocator | $allocator | ) |
Creates new instance of the object.
workshop_allocator | $allocator |
workshop_allocation_result::get_logs | ( | ) |
Returns list of logged messages.
Each object in the list has public properties message string, text to display type string, the type of the message indent int, indentation level
array | of log objects |
workshop_allocation_result::get_message | ( | ) |
string|null | status message |
workshop_allocation_result::get_status | ( | ) |
int|null | the result status |
workshop_allocation_result::get_timeend | ( | ) |
int|null | the timestamp of when the final status was set |
workshop_allocation_result::log | ( | $message, | |
$type = 'ok' , |
|||
$indent = 0 |
|||
) |
Appends a new message to the log.
The available levels are ok - success, eg. new allocation was created info - informational message error - error message, eg. no more peers available debug - debugging info
string | $message | message text to display |
string | $type | the type of the message |
int | $indent | eventual indentation level (the message is related to the previous one with the lower indent) |
workshop_allocation_result::set_status | ( | $status, | |
$message = null |
|||
) |
Sets the result status of the allocation.
int | $status | the status code, eg self::STATUS_OK |
string | $message | optional status message |
|
protected |
of log message objects, {