magento / magento/community-features
Please make Models, ResourceModel and Collection _construct method abstract.
Nobody has claimed this yet.
- Dominant language
- No language data
- Stars
- 46
- Forks
- 14
- PR merge metrics
- No merged PRs in 30d
Description
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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Locate the core abstract Model, ResourceModel, and Collection classes under Magento\Framework\Model and review how their subclasses currently implement _construct() and call _init(). The work is done when those base classes enforce the required implementation and existing model, resource-model, and collection initialization continues to work.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- php
- Domain
- backend
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100