@@ 12-41 (lines=30) @@ | ||
9 | use Oro\Bundle\MigrationBundle\Migration\Migration; |
|
10 | use Oro\Bundle\MigrationBundle\Migration\QueryBag; |
|
11 | ||
12 | class InheritanceActivityTargets implements Migration, ActivityListExtensionAwareInterface |
|
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($schema, 'orocrm_account', 'orocrm_contact', ['accounts']); |
|
40 | } |
|
41 | } |
|
42 |
@@ 12-41 (lines=30) @@ | ||
9 | use Oro\Bundle\MigrationBundle\Migration\Migration; |
|
10 | use Oro\Bundle\MigrationBundle\Migration\QueryBag; |
|
11 | ||
12 | class InheritanceActivityTargets implements Migration, ActivityListExtensionAwareInterface |
|
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($schema, 'orocrm_account', 'orocrm_case', ['relatedAccount']); |
|
40 | } |
|
41 | } |
|
42 |
@@ 12-46 (lines=35) @@ | ||
9 | use Oro\Bundle\MigrationBundle\Migration\Migration; |
|
10 | use Oro\Bundle\MigrationBundle\Migration\QueryBag; |
|
11 | ||
12 | class InheritanceActivityTargets implements Migration, ActivityListExtensionAwareInterface |
|
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 |