Code Duplication    Length = 60-60 lines in 2 locations

src/OroCRM/Bundle/MagentoBundle/Migrations/Schema/OroCRMMagentoBundleInstaller.php 2 locations

@@ 914-973 (lines=60) @@
911
     *
912
     * @param Schema $schema
913
     */
914
    protected function addOrocrmMagentoOrderForeignKeys(Schema $schema)
915
    {
916
        $table = $schema->getTable('orocrm_magento_order');
917
        $table->addForeignKeyConstraint(
918
            $schema->getTable('orocrm_magento_customer'),
919
            ['customer_id'],
920
            ['id'],
921
            ['onDelete' => 'SET NULL']
922
        );
923
        $table->addForeignKeyConstraint(
924
            $schema->getTable('orocrm_magento_store'),
925
            ['store_id'],
926
            ['id'],
927
            ['onDelete' => 'SET NULL']
928
        );
929
        $table->addForeignKeyConstraint(
930
            $schema->getTable('orocrm_magento_cart'),
931
            ['cart_id'],
932
            ['id'],
933
            []
934
        );
935
        $table->addForeignKeyConstraint(
936
            $schema->getTable('oro_workflow_item'),
937
            ['workflow_item_id'],
938
            ['id'],
939
            ['onDelete' => 'SET NULL']
940
        );
941
        $table->addForeignKeyConstraint(
942
            $schema->getTable('oro_workflow_step'),
943
            ['workflow_step_id'],
944
            ['id'],
945
            ['onDelete' => 'SET NULL']
946
        );
947
        $table->addForeignKeyConstraint(
948
            $schema->getTable('oro_user'),
949
            ['user_owner_id'],
950
            ['id'],
951
            ['onDelete' => 'SET NULL']
952
        );
953
        $table->addForeignKeyConstraint(
954
            $schema->getTable('oro_integration_channel'),
955
            ['channel_id'],
956
            ['id'],
957
            ['onDelete' => 'SET NULL']
958
        );
959
        $table->addForeignKeyConstraint(
960
            $schema->getTable('orocrm_channel'),
961
            ['data_channel_id'],
962
            ['id'],
963
            ['onDelete' => 'SET NULL', 'onUpdate' => null],
964
            'FK_4D09F305BDC09B73'
965
        );
966
        $table->addForeignKeyConstraint(
967
            $schema->getTable('oro_organization'),
968
            ['organization_id'],
969
            ['id'],
970
            ['onDelete' => 'SET NULL', 'onUpdate' => null],
971
            'FK_4D09F30532C8A3DE'
972
        );
973
    }
974
975
    /**
976
     * Add orocrm_magento_order_calls foreign keys.
@@ 1040-1099 (lines=60) @@
1037
     *
1038
     * @param Schema $schema
1039
     */
1040
    protected function addOrocrmMagentoCustomerForeignKeys(Schema $schema)
1041
    {
1042
        $table = $schema->getTable('orocrm_magento_customer');
1043
        $table->addForeignKeyConstraint(
1044
            $schema->getTable('orocrm_magento_website'),
1045
            ['website_id'],
1046
            ['id'],
1047
            ['onDelete' => 'SET NULL']
1048
        );
1049
        $table->addForeignKeyConstraint(
1050
            $schema->getTable('orocrm_magento_store'),
1051
            ['store_id'],
1052
            ['id'],
1053
            ['onDelete' => 'SET NULL']
1054
        );
1055
        $table->addForeignKeyConstraint(
1056
            $schema->getTable('orocrm_magento_customer_group'),
1057
            ['customer_group_id'],
1058
            ['id'],
1059
            ['onDelete' => 'SET NULL']
1060
        );
1061
        $table->addForeignKeyConstraint(
1062
            $schema->getTable('orocrm_contact'),
1063
            ['contact_id'],
1064
            ['id'],
1065
            ['onDelete' => 'SET NULL']
1066
        );
1067
        $table->addForeignKeyConstraint(
1068
            $schema->getTable('orocrm_account'),
1069
            ['account_id'],
1070
            ['id'],
1071
            ['onDelete' => 'SET NULL']
1072
        );
1073
        $table->addForeignKeyConstraint(
1074
            $schema->getTable('oro_user'),
1075
            ['user_owner_id'],
1076
            ['id'],
1077
            ['onDelete' => 'SET NULL']
1078
        );
1079
        $table->addForeignKeyConstraint(
1080
            $schema->getTable('oro_integration_channel'),
1081
            ['channel_id'],
1082
            ['id'],
1083
            ['onDelete' => 'SET NULL']
1084
        );
1085
        $table->addForeignKeyConstraint(
1086
            $schema->getTable('orocrm_channel'),
1087
            ['data_channel_id'],
1088
            ['id'],
1089
            ['onDelete' => 'SET NULL', 'onUpdate' => null],
1090
            'FK_2A61EE7DBDC09B73'
1091
        );
1092
        $table->addForeignKeyConstraint(
1093
            $schema->getTable('oro_organization'),
1094
            ['organization_id'],
1095
            ['id'],
1096
            ['onDelete' => 'SET NULL', 'onUpdate' => null],
1097
            'FK_2A61EE7D32C8A3DE'
1098
        );
1099
    }
1100
1101
    /**
1102
     * Add orocrm_magento_cart_item foreign keys.