Conditions | 3 |
Paths | 3 |
Total Lines | 13 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
36 | public function loadClassMetadata(ClassMetadata $metadata): bool |
||
37 | { |
||
38 | if (!$this->uploadsHelper->isConfigured($metadata->getClassName())) { |
||
39 | return false; |
||
40 | } |
||
41 | |||
42 | $fields = $this->uploadsHelper->getConfiguredProperties($metadata->getClassName(), true, false); |
||
43 | |||
44 | foreach ($fields as $fileField) { |
||
45 | $metadata->addPropertyConstraint($fileField, new Assert\NotNull(['groups' => sprintf('%s:create', $metadata->getClassName())])); |
||
46 | } |
||
47 | |||
48 | return true; |
||
49 | } |
||
51 |