1 | <?php |
||
18 | class PriceFactory implements PriceFactoryInterface |
||
19 | { |
||
20 | protected $creators = [ |
||
21 | EnumPrice::class => 'createEnumPrice', |
||
22 | SinglePrice::class => 'createSinglePrice', |
||
23 | ]; |
||
24 | |||
25 | protected $types = [ |
||
26 | 'enum' => EnumPrice::class, |
||
27 | 'single' => SinglePrice::class, |
||
28 | ]; |
||
29 | |||
30 | 2 | public function __construct(array $types = []) { |
|
33 | 2 | ||
34 | /** |
||
35 | * Creates price object. |
||
36 | * @return Price |
||
37 | */ |
||
38 | public function create(PriceCreationDto $dto) |
||
51 | |||
52 | public function createEnumPrice(PriceCreationDto $dto) |
||
56 | |||
57 | public function createSinglePrice(PriceCreationDto $dto) |
||
61 | } |
||
62 |