1 <?php
2 3 4
5 namespace Team3\PayU\Order\Transformer\UserOrder\Strategy;
6
7 use Team3\PayU\Order\Model\OrderInterface;
8 use Team3\PayU\Order\Transformer\UserOrder\TransformerProperties;
9 use Team3\PayU\PropertyExtractor\ExtractorResult;
10 use Team3\PayU\Order\Transformer\UserOrder\UserOrderTransformerInterface;
11
12 class RecursiveTransformerStrategy implements UserOrderTransformerStrategyInterface
13 {
14 15 16
17 private $transformer;
18
19 20 21
22 public function __construct(
23 UserOrderTransformerInterface $transformer
24 ) {
25 $this->transformer = $transformer;
26 }
27
28 29 30
31 public function transform(
32 OrderInterface $order,
33 ExtractorResult $extractorResult
34 ) {
35 $this->transformer->transform($order, $extractorResult->getValue());
36 }
37
38 39 40
41 public function supports($propertyName)
42 {
43 return TransformerProperties::RECURSIVE === $propertyName;
44 }
45 }
46