Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Mage::getModel(%Class_Name%) to %Class_Name%::new() #57

Closed
stalniy opened this issue Aug 1, 2012 · 1 comment
Closed

Change Mage::getModel(%Class_Name%) to %Class_Name%::new() #57

stalniy opened this issue Aug 1, 2012 · 1 comment

Comments

@stalniy
Copy link

stalniy commented Aug 1, 2012

To decrease static dependencies of Mage class you can replace

Mage::getModel('Mage_Catalog_Model_Product')

to

Mage_Catalog_Model_Product::new()
@magento-team
Copy link
Contributor

@stalniy
Thank you for the proposed code changes.

Entire mechanism of wrapping native object creation aims to support classes rewrite customization feature. Unfortunately,
proposed approach is incompatible with the class rewrites.

Regarding static dependencies on the Mage class, you're right, it does make sense to eliminate or at least reduce such dependencies. Currently, there is a research going on regarding the dependency injection container adoption for that purpose, stay tuned.

Closing the ticket, since proposed approach dramatically reduces existing customization capabilities.

magento-team pushed a commit that referenced this issue Feb 6, 2015
[South] Sprint 29 & Bug fixes
@stevieyu stevieyu mentioned this issue Apr 3, 2015
tang-yu pushed a commit that referenced this issue Nov 5, 2015
…e-Through-API-Service-Is-Not-Visible-On-Frontend

[API+FearlessKiwis+Vanilla] MAGETWO-39663 Product save through API, MAGETWO-44491 revert executeInternal to execute, Frontend Bug Fixes
magento-team pushed a commit that referenced this issue Mar 23, 2016
JS-354: Zoom buttons appear on video image in fullscreen
magento-engcom-team pushed a commit that referenced this issue Aug 2, 2018
… Data, Metadata, Page) (#57)

- Fixed duplicate elements.
magento-engcom-team pushed a commit that referenced this issue Aug 27, 2018
MAGETWO-91701: Newsletter subscription is not correctly updated when …
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants