Passed
Push — 6.4 ( 3d0a37...1ed39e )
by Christian
14:28 queued 13s
created

FlowTemplateDefinition::getEntityName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Core\Content\Flow\Aggregate\FlowTemplate;
4
5
use Shopware\Core\Content\Flow\DataAbstractionLayer\Field\FlowTemplateConfigField;
6
use Shopware\Core\Framework\DataAbstractionLayer\EntityDefinition;
7
use Shopware\Core\Framework\DataAbstractionLayer\Field\Flag\PrimaryKey;
8
use Shopware\Core\Framework\DataAbstractionLayer\Field\Flag\Required;
9
use Shopware\Core\Framework\DataAbstractionLayer\Field\IdField;
10
use Shopware\Core\Framework\DataAbstractionLayer\Field\StringField;
11
use Shopware\Core\Framework\DataAbstractionLayer\FieldCollection;
12
13
/**
14
 * @package business-ops
15
 */
16
class FlowTemplateDefinition extends EntityDefinition
17
{
18
    public const ENTITY_NAME = 'flow_template';
19
20
    public function getEntityName(): string
21
    {
22
        return self::ENTITY_NAME;
23
    }
24
25
    public function getCollectionClass(): string
26
    {
27
        return FlowTemplateCollection::class;
28
    }
29
30
    public function getEntityClass(): string
31
    {
32
        return FlowTemplateEntity::class;
33
    }
34
35
    public function since(): ?string
36
    {
37
        return '6.4.18.0';
38
    }
39
40
    protected function defineFields(): FieldCollection
41
    {
42
        return new FieldCollection([
43
            (new IdField('id', 'id'))->addFlags(new PrimaryKey(), new Required()),
44
            (new StringField('name', 'name', 255))->addFlags(new Required()),
45
            new FlowTemplateConfigField('config', 'config'),
46
        ]);
47
    }
48
}
49