A message from our CEO about the future of Stack Overflow and Stack Exchange. Read now.

Questions tagged [preference]

Denotes questions related to Magento 2 preferences

Filter by
Sorted by
Tagged with
21
votes
2answers
5k views

Magento 2: what is the $data array constructor parameter?

So I noticed that in most models and blocks, there's this array $data = [] given as the last parameter of the constructor. For example \Magento\Catalog\Block\Product\ListProduct public function ...
10
votes
1answer
2k views

Magento 2: get a list of all plugins (interceptors) and preferences

Is there a way I can retrieve the list of all plugins (with the methods they're plugged onto) and all preferences (and their original class) on a Magento 2 install.
4
votes
1answer
2k views

Magento 2, override \lib\ classes

Can you override the classes in \lib\internal\Magento\Framework and if so how? I know how to use plugins/preferences to override the classes in \code but these methods do no seem to work with the lib ...