magento / community-features

Magento Features Development is an Initiative to Allows Community Memebers Join to Development of Magento Features
46 stars 18 forks source link

Please make Models, ResourceModel and Collection _construct method abstract. #172

Open victortodoran opened 5 years ago

victortodoran commented 5 years ago

Every custom Model, ResourceModel and Collection that extends from the core abstract classes from Magento\Framework\Model\ ... has to implement the _construct() method in which to call the _init() method and set things like table_name and primary_key in the ResourceModel and so on.

That this is smelly code I'm sure that you are aware and I'm not judging God knows how much work you have going on.

But please enforce this by making the _construct() method abstract and leave a comment something like //call the init method a developer should not have to remember or memorize that every time he creates a Model(or any other entity related class) he has to implement some secret method or else things are not working.