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\Bundle\InvoiceBundle\Enhancer; |
14
|
|
|
|
15
|
|
|
use WellCommerce\Bundle\AppBundle\Entity\Shop; |
16
|
|
|
use WellCommerce\Component\DoctrineEnhancer\AbstractMappingEnhancer; |
17
|
|
|
use WellCommerce\Component\DoctrineEnhancer\Definition\FieldDefinition; |
18
|
|
|
use WellCommerce\Component\DoctrineEnhancer\Definition\MappingDefinitionCollection; |
19
|
|
|
use WellCommerce\Extra\AppBundle\Entity\ShopExtraTrait; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* Class ShopMappingEnhancer |
23
|
|
|
* |
24
|
|
|
* @author Adam Piotrowski <[email protected]> |
25
|
|
|
*/ |
26
|
|
|
final class ShopMappingEnhancer extends AbstractMappingEnhancer |
27
|
|
|
{ |
28
|
|
|
protected function configureMappingDefinition(MappingDefinitionCollection $collection) |
29
|
|
|
{ |
30
|
|
|
$collection->add(new FieldDefinition([ |
31
|
|
|
'fieldName' => 'invoiceMaturity', |
32
|
|
|
'type' => 'integer', |
33
|
|
|
'unique' => false, |
34
|
|
|
'nullable' => false, |
35
|
|
|
'columnName' => 'invoice_maturity', |
36
|
|
|
'options' => [ |
37
|
|
|
'default' => 7, |
38
|
|
|
], |
39
|
|
|
])); |
40
|
|
|
|
41
|
|
|
$collection->add(new FieldDefinition([ |
42
|
|
|
'fieldName' => 'invoiceProcessor', |
43
|
|
|
'type' => 'string', |
44
|
|
|
'nullable' => false, |
45
|
|
|
'columnName' => 'invoice_processor', |
46
|
|
|
'options' => [ |
47
|
|
|
'default' => 'invoice.processor.generic', |
48
|
|
|
], |
49
|
|
|
])); |
50
|
|
|
} |
51
|
|
|
|
52
|
|
|
public function getSupportedEntityClass(): string |
53
|
|
|
{ |
54
|
|
|
return Shop::class; |
55
|
|
|
} |
56
|
|
|
|
57
|
|
|
public function getExtraTraitClass(): string |
58
|
|
|
{ |
59
|
|
|
return ShopExtraTrait::class; |
60
|
|
|
} |
61
|
|
|
} |
62
|
|
|
|