From fd1a34604ebe1725b89f203e4287e58a10f2447b Mon Sep 17 00:00:00 2001 From: Benjamin Perche Date: Fri, 27 Jun 2014 10:03:14 +0200 Subject: [PATCH] =?UTF-8?q?Add=20load=20requirements=20in=20getTypeInstanc?= =?UTF-8?q?e=20=09modifi=C3=A9:=20=20=20=20=20=20=20=20=20core/lib/Thelia/?= =?UTF-8?q?Model/Tax.php?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/lib/Thelia/Model/Tax.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/lib/Thelia/Model/Tax.php b/core/lib/Thelia/Model/Tax.php index 654d3a31f..a1a73bad7 100644 --- a/core/lib/Thelia/Model/Tax.php +++ b/core/lib/Thelia/Model/Tax.php @@ -59,12 +59,14 @@ class Tax extends BaseTax if (!class_exists($class)) { throw new TaxEngineException('Recorded type `' . $class . '` does not exists', TaxEngineException::BAD_RECORDED_TYPE); } - + /** @var \Thelia\TaxEngine\BaseTaxType $instance */ $instance = new $class; if (!$instance instanceof BaseTaxType) { throw new TaxEngineException('Recorded type `' . $class . '` does not extends BaseTaxType', TaxEngineException::BAD_RECORDED_TYPE); } + + $instance->loadRequirements($this->getRequirements()); return $instance; }