Completed
Push — master ( 3f5763...5f0b1e )
by
unknown
11:44
created

addInheritanceTargets()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9
Code Lines 6

Duplication

Lines 9
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 9
loc 9
rs 9.6666
cc 1
eloc 6
nc 1
nop 2
1
<?php
2
3
namespace OroCRM\Bundle\SalesBundle\Migrations\Schema\v1_24;
4
5
use Doctrine\DBAL\Schema\Schema;
6
7
use Oro\Bundle\ActivityListBundle\Migration\Extension\ActivityListExtension;
8
use Oro\Bundle\ActivityListBundle\Migration\Extension\ActivityListExtensionAwareInterface;
9
use Oro\Bundle\MigrationBundle\Migration\Migration;
10
use Oro\Bundle\MigrationBundle\Migration\QueryBag;
11
12 View Code Duplication
class InheritanceActivityTargets implements Migration, ActivityListExtensionAwareInterface
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
13
{
14
    /** @var ActivityListExtension */
15
    protected $activityListExtension;
16
17
    /**
18
     * {@inheritdoc}
19
     */
20
    public function setActivityListExtension(ActivityListExtension $activityListExtension)
21
    {
22
        $this->activityListExtension = $activityListExtension;
23
    }
24
25
    /**
26
     * {@inheritdoc}
27
     */
28
    public function up(Schema $schema, QueryBag $queries)
29
    {
30
        self::addInheritanceTargets($schema, $this->activityListExtension);
31
    }
32
33
    /**
34
     * @param Schema $schema
35
     * @param ActivityListExtension $activityListExtension
36
     */
37
    public static function addInheritanceTargets(Schema $schema, ActivityListExtension $activityListExtension)
38
    {
39
        $activityListExtension->addInheritanceTargets(
40
            $schema,
41
            'orocrm_sales_opportunity',
42
            'orocrm_sales_lead',
43
            ['opportunities']
44
        );
45
    }
46
}
47