Passed
Push — 6.5.0.0 ( 27ba79...b0de28 )
by Christian
10:05 queued 12s
created

getParentDefinitionClass()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php declare(strict_types=1);
2
3
namespace Shopware\Core\System\SalesChannel\Aggregate\SalesChannelAnalytics;
4
5
use Shopware\Core\Framework\DataAbstractionLayer\EntityDefinition;
6
use Shopware\Core\Framework\DataAbstractionLayer\Field\BoolField;
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\OneToOneAssociationField;
11
use Shopware\Core\Framework\DataAbstractionLayer\Field\StringField;
12
use Shopware\Core\Framework\DataAbstractionLayer\FieldCollection;
13
use Shopware\Core\Framework\Log\Package;
14
use Shopware\Core\System\SalesChannel\SalesChannelDefinition;
15
16
#[Package('sales-channel')]
17
class SalesChannelAnalyticsDefinition extends EntityDefinition
18
{
19
    final public const ENTITY_NAME = 'sales_channel_analytics';
20
21
    public function getEntityName(): string
22
    {
23
        return self::ENTITY_NAME;
24
    }
25
26
    public function getCollectionClass(): string
27
    {
28
        return SalesChannelAnalyticsCollection::class;
29
    }
30
31
    public function getEntityClass(): string
32
    {
33
        return SalesChannelAnalyticsEntity::class;
0 ignored issues
show
Bug introduced by
The type Shopware\Core\System\Sal...sChannelAnalyticsEntity was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
34
    }
35
36
    public function getParentDefinitionClass(): ?string
37
    {
38
        return SalesChannelDefinition::class;
39
    }
40
41
    public function since(): ?string
42
    {
43
        return '6.2.0.0';
44
    }
45
46
    protected function defineFields(): FieldCollection
47
    {
48
        return new FieldCollection([
49
            (new IdField('id', 'id'))->addFlags(new PrimaryKey(), new Required()),
50
            new StringField('tracking_id', 'trackingId'),
51
            new BoolField('active', 'active'),
52
            new BoolField('track_orders', 'trackOrders'),
53
            new BoolField('anonymize_ip', 'anonymizeIp'),
54
            (new OneToOneAssociationField('salesChannel', 'id', 'analytics_id', SalesChannelDefinition::class, false)),
55
        ]);
56
    }
57
}
58