Completed
Push — master ( a54a4b...bbfdca )
by Adam
15:54
created

EmbeddableDefinition::configureOptions()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 8
nc 1
nop 1
1
<?php
2
/*
3
 * WellCommerce Open-Source E-Commerce Platform
4
 * 
5
 * This file is part of the WellCommerce package.
6
 *
7
 * (c) Adam Piotrowski <[email protected]>
8
 * 
9
 * For the full copyright and license information,
10
 * please view the LICENSE file that was distributed with this source code.
11
 */
12
13
namespace WellCommerce\Component\DoctrineEnhancer\Definition;
14
15
use Symfony\Component\OptionsResolver\OptionsResolver;
16
17
/**
18
 * Class EmbeddableDefinition
19
 *
20
 * @author  Adam Piotrowski <[email protected]>
21
 */
22
final class EmbeddableDefinition extends AbstractMappingDefinition
23
{
24
    public function configureOptions(OptionsResolver $resolver)
25
    {
26
        $resolver->setRequired([
27
            'fieldName',
28
            'class',
29
            'columnPrefix',
30
        ]);
31
        
32
        $resolver->setAllowedTypes('fieldName', 'string');
33
        $resolver->setAllowedTypes('class', 'string');
34
        $resolver->setAllowedTypes('columnPrefix', ['string', 'null']);
35
    }
36
    
37
    public function getClassMetadataMethod(): string
38
    {
39
        return MappingDefinitionInterface::CLASS_METADATA_METHOD_EMBEDDABLE;
40
    }
41
}
42