Added Model\Module::getModuleInstance() method
This commit is contained in:
@@ -64,7 +64,7 @@ class Delivery extends BaseSpecificModule
|
||||
$loopResultRow = new LoopResultRow($deliveryModule);
|
||||
|
||||
/** @var DeliveryModuleInterface $moduleInstance */
|
||||
$moduleInstance = $this->container->get(sprintf('module.%s', $deliveryModule->getCode()));
|
||||
$moduleInstance = $deliveryModule->getModuleInstance($this->container);
|
||||
|
||||
if (false === $moduleInstance instanceof DeliveryModuleInterface) {
|
||||
throw new \RuntimeException(sprintf("delivery module %s is not a Thelia\Module\DeliveryModuleInterface", $deliveryModule->getCode()));
|
||||
|
||||
@@ -37,7 +37,7 @@ class Payment extends BaseSpecificModule implements PropelSearchLoopInterface
|
||||
foreach ($loopResult->getResultDataCollection() as $paymentModule) {
|
||||
$loopResultRow = new LoopResultRow($paymentModule);
|
||||
|
||||
$moduleInstance = $this->container->get(sprintf('module.%s', $paymentModule->getCode()));
|
||||
$moduleInstance = $paymentModule->getModuleInstance($this->container);
|
||||
|
||||
if (false === $moduleInstance instanceof PaymentModuleInterface) {
|
||||
throw new \RuntimeException(sprintf("payment module %s is not a Thelia\Module\PaymentModuleInterface", $paymentModule->getCode()));
|
||||
|
||||
@@ -169,7 +169,7 @@ class CartPostage extends AbstractSmartyPlugin
|
||||
foreach ($deliveryModules as $deliveryModule) {
|
||||
|
||||
/** @var DeliveryModuleInterface $moduleInstance */
|
||||
$moduleInstance = $this->container->get(sprintf('module.%s', $deliveryModule->getCode()));
|
||||
$moduleInstance = $deliveryModule->getModuleInstance($this->container);
|
||||
|
||||
if (false === $moduleInstance instanceof DeliveryModuleInterface) {
|
||||
throw new \RuntimeException(sprintf("delivery module %s is not a Thelia\Module\DeliveryModuleInterface", $deliveryModule->getCode()));
|
||||
|
||||
Reference in New Issue
Block a user