State trait helper, with common methods.
Copyright: | 2023 Sara Arjona (sara@moodle.com) |
License: | http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later |
File Size: | 99 lines (3 kb) |
Included or required: | 0 times |
Referenced: | 0 times |
Includes or requires: | 0 files |
validate_component(string $component) X-Ref |
Check component name. Note: this function is separated mainly for testing purposes to be overridden to fake components. param: string $component component name |
get_agent_from_json(string $agentjson) X-Ref |
Convert a JSON agent into a valid item_agent. param: string $agentjson JSON encoded agent structure return: item_agent the agent |
check_state_user(state $state) X-Ref |
Check that $USER is actor in state. param: state $state The state return: bool if $USER is actor of the state |
get_statedata_from_json(string $statedatajson) X-Ref |
Convert the state data JSON into valid object. param: string $statedatajson JSON encoded structure return: stdClass the state data structure |