-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Milestone
Description
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 getaddress how to extend resource models- need to take into consideration Allow different self links for self and resource's #25, Allow resource links to another API base #28, Add tablespace prefix for model class attributes #24, Improve resource cache #34
NOTES
- We should look into get(..., $targetModel = null) solution if it works