1 | <?php |
||
26 | class FileUploadFactory implements FactoryInterface |
||
27 | { |
||
28 | /** |
||
29 | * Service name of the form element used. |
||
30 | * |
||
31 | * @var string |
||
32 | */ |
||
33 | protected $fileElement = 'Core/FileUpload'; |
||
34 | |||
35 | /** |
||
36 | * Name of the form element. |
||
37 | * |
||
38 | * @var string |
||
39 | */ |
||
40 | protected $fileName = 'file'; |
||
41 | |||
42 | /** |
||
43 | * Class name of the file entity to use. |
||
44 | * |
||
45 | * @var string |
||
46 | */ |
||
47 | protected $fileEntityClass = '\Core\Form\FileEntity'; |
||
48 | |||
49 | /** |
||
50 | * Should the factored element allow multiple files to be selected? |
||
51 | * |
||
52 | * @var bool |
||
53 | */ |
||
54 | protected $multiple = false; |
||
55 | |||
56 | /** |
||
57 | * The config key in the FileUploadFactory configuration entry. |
||
58 | * @var string |
||
59 | */ |
||
60 | protected $configKey; |
||
61 | |||
62 | /** |
||
63 | * The configuration stored in the FileUploadFactory configuration entry under {@link $configKey}. |
||
64 | * |
||
65 | * @var array|null |
||
66 | */ |
||
67 | protected $config; |
||
68 | |||
69 | /** |
||
70 | * Optional Module Options. eg. "Jobs/Options" or "Applications/Options" |
||
71 | * |
||
72 | * @var string|null |
||
73 | */ |
||
74 | protected $options; |
||
75 | |||
76 | /** |
||
77 | * The configuration from the FileUploadFactory configuration |
||
78 | * |
||
79 | * @param ServiceLocatorInterface $serviceLocator |
||
80 | * @return Form |
||
81 | */ |
||
82 | public function createService(ServiceLocatorInterface $serviceLocator) |
||
163 | |||
164 | /** |
||
165 | * Configures the factored form. |
||
166 | * |
||
167 | * @param \Core\Form\Form $form |
||
168 | * @param AbstractOptions $options |
||
169 | */ |
||
170 | protected function configureForm($form, AbstractOptions $options) |
||
173 | } |
||
174 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: