Extend Core model
From LimeSurvey Manual
Some plugin can like to extend core model. We already can use /replace/extend all controller. Then , have a way to extend all model seems interesting.
Exemple of interest
- Auth_LDAP plugin included in core model : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/models/Permission.php#L244 mus be moved in own plugin
- A Permission on survey must be writed in Permission table : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/models/Survey.php#L1039 else list is broken. See https://github.com/SondagesPro/surveysModel/blob/master/surveysModel.php#L118 : updating permission each time ....
- I thinking of a Plugin to allow to use specific order in any questuons. Or to move a specific Answer at last (see javascript workaround) : must extend Question::model => https://github.com/LimeSurvey/LimeSurvey/blob/master/application/models/Question.php#L750
Existing solution
- We already have some event : https://github.com/LimeSurvey/LimeSurvey/blob/master/application/models/behaviors/PluginEventBehavior.php
- We can add same event onBeforeFind, onAfterFind etc ... and maybe allow update some part (criteria for example) : but : limited to choosen function, happen even if we don't need it (memory issue ?)