Actions

Extend Core model: Difference between revisions

From LimeSurvey Manual

(Exemple of interest)
 
(Existing solution)
 
Line 5: Line 5:
* 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 ....
* 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
* 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 [http://www.yiiframework.com/doc/api/1.1/CActiveRecord#onBeforeFind-detail 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 ?)


[[Category:Plugin Development]]
[[Category:Plugin Development]]

Latest revision as of 17:15, 27 July 2016

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

Existing solution