Uses new helper functions

This commit is contained in:
Franck Allimant
2014-04-26 16:02:23 +02:00
parent addbd9a84c
commit 5c6940b427
5 changed files with 7 additions and 15 deletions

View File

@@ -74,8 +74,7 @@ class OrderDelivery extends BaseForm
if (null === $module) {
$context->addViolation(Translator::getInstance()->trans("Delivery module ID not found"));
} else {
$moduleReflection = new \ReflectionClass($module->getFullNamespace());
if ($moduleReflection->isSubclassOf("Thelia\Module\DeliveryModuleInterface") === false) {
if (! $module->isDeliveryModule()) {
$context->addViolation(
sprintf(Translator::getInstance()->trans("delivery module %s is not a Thelia\Module\DeliveryModuleInterface"), $module->getCode())
);

View File

@@ -75,8 +75,7 @@ class OrderPayment extends BaseForm
$context->addViolation("Payment module ID not found");
}
$moduleReflection = new \ReflectionClass($module->getFullNamespace());
if ($moduleReflection->isSubclassOf("Thelia\Module\PaymentModuleInterface") === false) {
if (! $module->isPayementModule()) {
$context->addViolation(
sprintf(Translator::getInstance()->trans("payment module %s is not a Thelia\Module\PaymentModuleInterface"), $module->getCode())
);