1 | <?php |
||
30 | class PriceModelFactory |
||
31 | { |
||
32 | /** |
||
33 | * @var array |
||
34 | */ |
||
35 | protected $map = [ |
||
36 | 'Price' => Price::class, |
||
37 | 'RatePrice' => RatePrice::class, |
||
38 | 'TemplatePrice' => TemplatePrice::class, |
||
39 | 'RateTemplatePrice' => TemplatePrice::class, |
||
40 | 'OveruseServerPrice' => OveruseServerPrice::class, |
||
41 | 'SinglePrice' => [ |
||
42 | 'domain,*' => DomainZonePrice::class, |
||
43 | 'feature,*' => DomainServicePrice::class, |
||
44 | 'overuse,server_traf95_max' => OveruseServerPrice::class, |
||
45 | '*' => Price::class, |
||
46 | ], |
||
47 | 'CertificatePrice' => CertificatePrice::class, |
||
48 | 'EnumPrice' => CertificatePrice::class, |
||
49 | 'DomainZonePrice' => DomainZonePrice::class, |
||
50 | 'DomainServicePrice' => DomainServicePrice::class, |
||
51 | ]; |
||
52 | |||
53 | /** |
||
54 | * @param string $className |
||
55 | * @param string|null $priceType |
||
56 | * @throws InvalidConfigException |
||
57 | * @return Price |
||
58 | */ |
||
59 | public function build(string $className, ?string $priceType = null) |
||
75 | |||
76 | /** |
||
77 | * @return array |
||
78 | */ |
||
79 | public function getMap(): array |
||
83 | |||
84 | public function instantiate(string $className): Model |
||
88 | } |
||
89 |