The base model holds a reference to the db (from ApplicationController) used for all database operations, but that's all it does.
There are a lot of similar methods/functionality in models, and it would be ideal if we could rationalise any duplication and move it higher up in the hierarchy for reuse; and define the minimum interface that models performing a specific role are required to implement (e.g. all entities need the methods find, save, remove,fromJson,torsion` etc.)
The table below lists the common methods for each model:
In addition, both the Program & Series models have a number of similar setXXXCount() methods that update the progress bar display, which may be able to refactored to reduce duplicate code.
All models currently extend from a
Base
model.The base model holds a reference to the
db
(fromApplicationController
) used for all database operations, but that's all it does.There are a lot of similar methods/functionality in models, and it would be ideal if we could rationalise any duplication and move it higher up in the hierarchy for reuse; and define the minimum interface that models performing a specific role are required to implement (e.g. all entities need the methods
find
,save
, remove,
fromJson,
torsion` etc.)The table below lists the common methods for each model:
In addition, both the
Program
&Series
models have a number of similarsetXXXCount()
methods that update the progress bar display, which may be able to refactored to reduce duplicate code.