Our goal is to get rid off resource Model inheritance drawbacks when extending an model
For example a major issue is get method implementation which relies on current model's getFields, getFilterable etc methods, modifications made for this method at the extended class are not effecting the behaviour of get, leading in errors or unnecessary rewrite of get method at the extended method.
Furthermore we have to improve and simplify the definitions of models.
class InternalModel
{
function get
function getById
}
class User extends ResourceModel
{
protected static $model = null;
public static getModel()
{
if (static::$model) {
static::$model = new InternalModel()
->setPage(new Page(1))
);
return static::$model;
}
}
in a controller
$users = User::get(new Page(25));
TODO
address definition of get
address how to extend resource models
need to take into consideration #25, #28, #24, #34
NOTES
We should look into get(..., $targetModel = null) solution if it works
Our goal is to get rid off resource Model inheritance drawbacks when extending an model
For example a major issue is
get
method implementation which relies on current model'sgetFields
,getFilterable
etc methods, modifications made for this method at the extended class are not effecting the behaviour ofget
, leading in errors or unnecessary rewrite of get method at the extended method.Furthermore we have to improve and simplify the definitions of models.
in a controller
TODO
address definition of getaddress how to extend resource modelsNOTES