protected static function format_lesson_messages($lesson) {
        $messages = array();
        foreach ($lesson->messages as $message) {
            $messages[] = array(
                'message' => $message[0],
                'type' => $message[1],
            );
        }
        return $messages;
    }
protected static function format_lesson_messages($lesson) {
        $messages = array();
        foreach ($lesson->messages as $message) {
            $messages[] = array(
                'message' => $message[0],
                'type' => $message[1],
            );
        }
        return $messages;
    }
protected static function format_lesson_messages ( $ lesson ) { $ messages = array ( ) ; foreach ( $ lesson -> messages as $ message ) { $ messages [ ] = array ( 'message' => $ message [ 0 ] , 'type' => $ message [ 1 ] , ) ; } return $ messages ; }
Return lesson messages formatted according the external_messages structure

@param  lesson $lesson lesson instance
@return array          messages formatted
@since Moodle 3.3
Return lesson messages formatted according the external_messages structure