The domain of this application closely follows Moodle's domain with a few atribute omissions that are not necessary in this context.
The Config class represents all the necessary information about a Moodle in order to comunicate with it. Parameters like username, password, the host, etc. are all stored here. Since the application supports multiple Moodles there can be more than one Config.
The Course class stores the necessary information about a course and it's sections.
For more information about a Course, click here to see the Moodle docs.
The Section class stores the necessary information about a section and it's modules.
For more information about a Section, click here to see the Moodle docs.
The Section class can store a Module or a LinkableContent.
You should use a Module if it's modname
has a domain represention or if it has a contents
property. If none of those
conditions are true, use a LinkableContent with the module's url.
You can obtain the modname
and contents
property through the Moodle Web Services function:
core_course_get_contents
.
The Module class stores the necessary information about a module and it's contents.
For more information about a Module, click here to see the Moodle docs.
LinkableContent, like Config, isn't present in a Moodle's domain. In this program it is used to store information about contents/resources that haven't (or won't) be implemented in the application.
This information includes:
- Where the content is (either a section or a module)
- If it has a id of it's own (usually contents don't have an id, but modules do)
- Name
- URL
The same logic applies here. If the content is a file or a known domain class, use that class. Otherwise just store it's URL in a LinkableContent.
The File class stores the necessary information about a file.
For more information about a File, click here to see the Moodle docs.