#5 Improve validation logic

開啟中
libsys5 年之前創建 · 1 條評論

1- Triggering validation automatically previous to CRUD operations makes this operations difficult to extend, since validation would be triggered after the custom behavior if you call parent::operation() on the last line of the method.

2- Rules use to be different previous to insertion than after insertion.

3- As rules are static it's impossible to validate based on dynamic data.

Still I think validation rules belong to models. One approach could be to craft a pre-insertion and a post-insertion validation method. An approach could be to

1- Triggering validation automatically previous to CRUD operations makes this operations difficult to extend, since validation would be triggered after the custom behavior if you call `parent::operation()` on the last line of the method. 2- Rules use to be different previous to insertion than after insertion. 3- As rules are static it's impossible to validate based on dynamic data. Still I think validation rules belong to models. One approach could be to craft a pre-insertion and a post-insertion validation method. An approach could be to
/lib/sys 評論 5 年之前'
所有者

Wow! That approach seems very convincing to me, but I think it would be better to

Wow! That approach seems very convincing to me, but I think it would be better to
登入 才能加入這對話。
未選擇標籤
未選擇里程碑
未指派成員
1 參與者
正在加載...
取消
保存
尚未有任何內容