1 | <?php |
||
20 | class ConditionProcessorFactory implements SingletonInterface |
||
21 | { |
||
22 | /** |
||
23 | * @var ConditionProcessorFactory |
||
24 | */ |
||
25 | private static $instance; |
||
26 | |||
27 | /** |
||
28 | * @var ConditionProcessor[] |
||
29 | */ |
||
30 | private $processorInstances = []; |
||
31 | |||
32 | /** |
||
33 | * @return ConditionProcessorFactory |
||
34 | */ |
||
35 | public static function getInstance() |
||
45 | |||
46 | /** |
||
47 | * @param FormObject $formObject |
||
48 | * @return ConditionProcessor |
||
49 | */ |
||
50 | public function get(FormObject $formObject) |
||
60 | |||
61 | /** |
||
62 | * Will either fetch the processor instance from cache, using the given |
||
63 | * identifier, or calculate it and store it in cache. |
||
64 | * |
||
65 | * @param string $cacheIdentifier |
||
66 | * @param FormObject $formObject |
||
67 | * @return ConditionProcessor |
||
68 | */ |
||
69 | protected function getProcessorInstance($cacheIdentifier, FormObject $formObject) |
||
90 | } |
||
91 |