1 | <?php |
||
20 | class PriceModelFactory |
||
21 | { |
||
22 | /** |
||
23 | * @var array |
||
24 | */ |
||
25 | protected $map = [ |
||
26 | 'Price' => Price::class, |
||
27 | 'TemplatePrice' => TemplatePrice::class, |
||
28 | 'SinglePrice' => [ |
||
29 | 'domain,*' => DomainZonePrice::class, |
||
30 | 'feature,*' => DomainServicePrice::class, |
||
31 | '*' => Price::class |
||
32 | ], |
||
33 | 'CertificatePrice' => CertificatePrice::class, |
||
34 | 'EnumPrice' => CertificatePrice::class, |
||
35 | 'DomainZonePrice' => DomainZonePrice::class, |
||
36 | 'DomainServicePrice' => DomainServicePrice::class, |
||
37 | ]; |
||
38 | |||
39 | /** |
||
40 | * @param string $className |
||
41 | * @param null|string $priceType |
||
42 | * @return Price |
||
43 | * @throws InvalidConfigException |
||
44 | */ |
||
45 | public function build(string $className, ?string $priceType = null) |
||
61 | |||
62 | /** |
||
63 | * @return array |
||
64 | */ |
||
65 | public function getMap(): array |
||
69 | |||
70 | public function instantiate(string $className): Model |
||
74 | } |
||
75 |