zf2 - input type file
Code (php)
1
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'company_logo' cannot be null
In de database mag dit veld null zijn en ook in de annotations staat dit aangegeven:
Code (php)
1
2
3
4
5
6
7
8
9
10
2
3
4
5
6
7
8
9
10
/**
* @var integer
*
* @ORM\Column(name="company_logo", type="string", length=255, nullable=true)
*
* @Annotation\Type("Zend\Form\Element\File")
* @Annotation\Filter({"name":"StripTags"})
* @Annotation\Options({"label":"Logo:"})
*/
private $companylogo;
* @var integer
*
* @ORM\Column(name="company_logo", type="string", length=255, nullable=true)
*
* @Annotation\Type("Zend\Form\Element\File")
* @Annotation\Filter({"name":"StripTags"})
* @Annotation\Options({"label":"Logo:"})
*/
private $companylogo;
Wanneer ik het inputfilter van het betreffende element dump op mijn scherm, krijg ik het volgende:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
object(stdClass)#1162 (15) {
["__CLASS__"]=>
string(26) "Zend\InputFilter\FileInput"
["isValid"]=>
bool(false)
["autoPrependUploadValidator"]=>
bool(true)
["allowEmpty"]=>
bool(true)
["continueIfEmpty"]=>
bool(true)
["breakOnFailure"]=>
bool(false)
["errorMessage"]=>
NULL
["filterChain"]=>
object(stdClass)#1216 (4) {
["__CLASS__"]=>
string(23) "Zend\Filter\FilterChain"
["plugins"]=>
NULL
["filters"]=>
string(25) "Zend\Stdlib\PriorityQueue"
["options"]=>
string(8) "Array(0)"
}
["name"]=>
string(11) "companylogo"
["notEmptyValidator"]=>
bool(false)
["required"]=>
bool(false)
["validatorChain"]=>
object(stdClass)#1220 (4) {
["__CLASS__"]=>
string(29) "Zend\Validator\ValidatorChain"
["plugins"]=>
NULL
["validators"]=>
string(8) "Array(0)"
["messages"]=>
string(8) "Array(0)"
}
["value"]=>
NULL
["fallbackValue"]=>
NULL
["hasFallback"]=>
bool(false)
}
["__CLASS__"]=>
string(26) "Zend\InputFilter\FileInput"
["isValid"]=>
bool(false)
["autoPrependUploadValidator"]=>
bool(true)
["allowEmpty"]=>
bool(true)
["continueIfEmpty"]=>
bool(true)
["breakOnFailure"]=>
bool(false)
["errorMessage"]=>
NULL
["filterChain"]=>
object(stdClass)#1216 (4) {
["__CLASS__"]=>
string(23) "Zend\Filter\FilterChain"
["plugins"]=>
NULL
["filters"]=>
string(25) "Zend\Stdlib\PriorityQueue"
["options"]=>
string(8) "Array(0)"
}
["name"]=>
string(11) "companylogo"
["notEmptyValidator"]=>
bool(false)
["required"]=>
bool(false)
["validatorChain"]=>
object(stdClass)#1220 (4) {
["__CLASS__"]=>
string(29) "Zend\Validator\ValidatorChain"
["plugins"]=>
NULL
["validators"]=>
string(8) "Array(0)"
["messages"]=>
string(8) "Array(0)"
}
["value"]=>
NULL
["fallbackValue"]=>
NULL
["hasFallback"]=>
bool(false)
}
Heeft iemand enig idee?
Er zijn nog geen reacties op dit bericht.