isotope / core

Core repository of Isotope eCommerce, an eCommerce extension for Contao Open Source CMS
https://isotopeecommerce.org
136 stars 107 forks source link

Remove type from model constructor argument #2513

Closed fritzmg closed 7 months ago

fritzmg commented 7 months ago

Contao's base \Contao\Model class has no type on its constructor argument, as it allows both \Contao\Database\Result and array:

https://github.com/contao/contao/blob/7477d95ccb3cff5f5e315d9163904ebae8f1a0b3/core-bundle/src/Resources/contao/library/Contao/Model.php#L108-L110

This way you can pass an associative array from a database result (e.g. from doctrine/dbal) when instantiating a model. However, this is currently not possible with all of the Isotope models as they define the \Contao\Database\Result for the constructor argument. This PR fixes that.

fritzmg commented 7 months ago

Rebased to 2.9 now.

aschempp commented 7 months ago

Thank you @fritzmg