Skip to content
philcali edited this page Dec 12, 2011 · 1 revision

A DAO is a data access object, a term popularized by the J2EE pattern. The UES DAO API is a convenience wrapper over common Moodle $DB calls and provides developers a means to map classes to tables by class names, and the ability to make use of implicit meta data for those objects.

Backend Requirements

For the most simplistic extension:

  1. All tables must prefix with enrol_, because the data maybe directly associated with the Universal Enrollment Service.
  2. The class name is singular in verbiage and plural as a table name, ie: my_employee maps to enrol_my_employees.
  3. If using meta information, a separate meta table with meta as the suffix in the table, ie: enrol_my_employeemeta. Meta tables have the fields: id, name, value, parentid, where parent is the parent's class name, ie: my_employeeid.

DAO Without Meta Information

A DAO without meta information, can inherit from ues_external, which provides all the DAO API without the extra save and remove call to meta tables.

DAO With Meta Information

A DAO with meta information, can inherit from ues_dao, which provides all the DAO API, including implicit meta data retrieval.

Extending the Data

All of the core DAO's have meta data capabilities. This means it is possible to store data about a semester, section, student, etc without having to modify the fields to the related tables. Should your data have similar requirements, then it is recommended to do the same.