-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
2.9.2
-
None
-
MOODLE_29_STABLE
-
MDL-51506-master -
- Run the test suite for tool_lp
- mdk phpunit -r --testsuite tool_lp
- Run the test suite for tool_lp
-
2
-
CBE Sprint 0
We need the models (persistent classes) to be able to validate themselves. The main reason behind this is that we cannot trust the data that is coming from other sources than web services or forms, for instance data manipulated by a developer, data from other sources such as CSV files, etc...
The API methods are not the right place to put this validation because the persistent classes can be used directly and enforcing the API use will be very difficult.
Defining validation within the model is the first step, later on we could re-use the validation definitions in forms, or even in external functions parameters/return definitions.
When working on this, grep for TODOs related to MDL-51506.