1 | <?php |
||
12 | class BaristaFactory implements FactoryInterface |
||
13 | { |
||
14 | /** |
||
15 | * @var AssetManifestFactory |
||
16 | */ |
||
17 | private $manifest_factory; |
||
18 | |||
19 | /** |
||
20 | * @var BaristaInterface[] |
||
21 | */ |
||
22 | private static $baristas = []; |
||
23 | |||
24 | /** |
||
25 | * @var LoaderInterface $loader |
||
26 | */ |
||
27 | protected $loader; |
||
28 | |||
29 | |||
30 | /** |
||
31 | * BaristaFactory constructor. |
||
32 | * |
||
33 | * @param AssetManifestFactory $manifest_factory |
||
34 | * @param LoaderInterface $loader |
||
35 | */ |
||
36 | public function __construct(AssetManifestFactory $manifest_factory, LoaderInterface $loader) |
||
41 | |||
42 | |||
43 | /** |
||
44 | * @param DomainInterface $domain |
||
45 | * @return BaristaInterface |
||
46 | */ |
||
47 | public function createFromDomainObject(DomainInterface $domain) |
||
52 | |||
53 | |||
54 | /** |
||
55 | * @param string $domain_fqcn Fully Qualified Class Name for the applicable DomainInterface class |
||
56 | * @param array $domain_arguments arguments required by the applicable DomainInterface class |
||
57 | * @return BaristaInterface |
||
58 | */ |
||
59 | public function create($domain_fqcn = '', array $domain_arguments = []) |
||
65 | |||
66 | |||
67 | /** |
||
68 | * @param AssetManifestInterface $asset_manifest |
||
69 | * @param DomainInterface $domain |
||
70 | * @return BaristaInterface |
||
71 | */ |
||
72 | private function getBaristaForDomain(AssetManifestInterface $asset_manifest, DomainInterface $domain) |
||
83 | |||
84 | |||
85 | /** |
||
86 | * @param string $domain_fqcn Fully Qualified Class Name for the applicable DomainInterface class |
||
87 | * @param array $arguments |
||
88 | * @return DomainInterface |
||
89 | */ |
||
90 | private function getDomain($domain_fqcn, array $arguments = []) |
||
112 | } |
||
113 |