1 | <?php |
||
33 | class FormObjectFactory implements SingletonInterface |
||
34 | { |
||
35 | use ExtendedSelfInstantiateTrait; |
||
36 | |||
37 | const IGNORE_PROPERTY = 'formz-ignore'; |
||
38 | |||
39 | /** |
||
40 | * @var ConfigurationFactory |
||
41 | */ |
||
42 | protected $configurationFactory; |
||
43 | |||
44 | /** |
||
45 | * @var TypoScriptService |
||
46 | */ |
||
47 | protected $typoScriptService; |
||
48 | |||
49 | /** |
||
50 | * @var FormObject[] |
||
51 | */ |
||
52 | protected $instances = []; |
||
53 | |||
54 | /** |
||
55 | * @var FormObjectStatic[] |
||
56 | */ |
||
57 | protected $static = []; |
||
58 | |||
59 | /** |
||
60 | * @var FormObjectProxy[] |
||
61 | */ |
||
62 | protected $proxy = []; |
||
63 | |||
64 | /** |
||
65 | * @var array |
||
66 | */ |
||
67 | private static $ignoredProperties = ['validationData', 'uid', 'pid', '_localizedUid', '_languageUid', '_versionedUid']; |
||
68 | |||
69 | /** |
||
70 | * Will create an instance of `FormObject` based on a class which implements |
||
71 | * the interface `FormInterface`. |
||
72 | * |
||
73 | * @param string $className |
||
74 | * @param string $name |
||
75 | * @return FormObject |
||
76 | */ |
||
77 | public function getInstanceFromClassName($className, $name) |
||
84 | |||
85 | /** |
||
86 | * @param FormInterface $form |
||
87 | * @param string $name |
||
88 | * @return FormObject |
||
89 | */ |
||
90 | public function getInstanceFromFormInstance(FormInterface $form, $name = 'defaultName') |
||
103 | |||
104 | /** |
||
105 | * @param FormObject $formObject |
||
106 | * @param FormInterface $form |
||
107 | * @return FormObjectProxy |
||
108 | */ |
||
109 | public function getProxy(FormObject $formObject, FormInterface $form) |
||
121 | |||
122 | /** |
||
123 | * @param string $className |
||
124 | * @return FormObjectStatic |
||
125 | * @throws ClassNotFoundException |
||
126 | * @throws InvalidArgumentTypeException |
||
127 | */ |
||
128 | protected function getStaticInstance($className) |
||
164 | |||
165 | /** |
||
166 | * Creates and initializes a new `StaticFormObject` instance. |
||
167 | * |
||
168 | * @param string $className |
||
169 | * @return FormObjectStatic |
||
170 | */ |
||
171 | protected function createInstance($className) |
||
184 | |||
185 | /** |
||
186 | * Will insert all the accessible properties of the given instance. |
||
187 | * |
||
188 | * @param FormObjectStatic $instance |
||
189 | */ |
||
190 | protected function insertObjectProperties(FormObjectStatic $instance) |
||
214 | |||
215 | /** |
||
216 | * @param string $className |
||
217 | * @return string |
||
218 | */ |
||
219 | protected function getCacheIdentifier($className) |
||
225 | |||
226 | /** |
||
227 | * @param ConfigurationFactory $configurationFactory |
||
228 | */ |
||
229 | public function injectConfigurationFactory(ConfigurationFactory $configurationFactory) |
||
233 | |||
234 | /** |
||
235 | * @param TypoScriptService $typoScriptService |
||
236 | */ |
||
237 | public function injectTypoScriptService(TypoScriptService $typoScriptService) |
||
241 | } |
||
242 |