Code Duplication    Length = 10-12 lines in 6 locations

src/OroCRM/Bundle/MagentoBundle/Migrations/Schema/v1_0/OroCRMMagentoBundle.php 3 locations

@@ 905-916 (lines=12) @@
902
     *
903
     * @param Schema $schema
904
     */
905
    public static function orocrmMagentoCustomerGroupForeignKeys(Schema $schema)
906
    {
907
        /** Generate foreign keys for table orocrm_magento_customer_group **/
908
        $table = $schema->getTable('orocrm_magento_customer_group');
909
        $table->addForeignKeyConstraint(
910
            $schema->getTable('oro_integration_channel'),
911
            ['channel_id'],
912
            ['id'],
913
            ['onDelete' => 'SET NULL', 'onUpdate' => null]
914
        );
915
        /** End of generate foreign keys for table orocrm_magento_customer_group **/
916
    }
917
918
    /**
919
     * Generate foreign keys for table orocrm_magento_order
@@ 1091-1102 (lines=12) @@
1088
     *
1089
     * @param Schema $schema
1090
     */
1091
    public static function orocrmMagentoProductForeignKeys(Schema $schema)
1092
    {
1093
        /** Generate foreign keys for table orocrm_magento_product **/
1094
        $table = $schema->getTable('orocrm_magento_product');
1095
        $table->addForeignKeyConstraint(
1096
            $schema->getTable('oro_integration_channel'),
1097
            ['channel_id'],
1098
            ['id'],
1099
            ['onDelete' => 'SET NULL', 'onUpdate' => null]
1100
        );
1101
        /** End of generate foreign keys for table orocrm_magento_product **/
1102
    }
1103
1104
    /**
1105
     * Generate foreign keys for table orocrm_magento_product_to_website
@@ 1158-1169 (lines=12) @@
1155
     *
1156
     * @param Schema $schema
1157
     */
1158
    public static function orocrmMagentoWebsiteForeignKeys(Schema $schema)
1159
    {
1160
        /** Generate foreign keys for table orocrm_magento_website **/
1161
        $table = $schema->getTable('orocrm_magento_website');
1162
        $table->addForeignKeyConstraint(
1163
            $schema->getTable('oro_integration_channel'),
1164
            ['channel_id'],
1165
            ['id'],
1166
            ['onDelete' => 'SET NULL', 'onUpdate' => null]
1167
        );
1168
        /** End of generate foreign keys for table orocrm_magento_website **/
1169
    }
1170
}
1171

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

@@ 1030-1039 (lines=10) @@
1027
     *
1028
     * @param Schema $schema
1029
     */
1030
    protected function addOrocrmMagentoCustomerGroupForeignKeys(Schema $schema)
1031
    {
1032
        $table = $schema->getTable('orocrm_magento_customer_group');
1033
        $table->addForeignKeyConstraint(
1034
            $schema->getTable('oro_integration_channel'),
1035
            ['channel_id'],
1036
            ['id'],
1037
            ['onDelete' => 'SET NULL']
1038
        );
1039
    }
1040
1041
    /**
1042
     * Add orocrm_magento_customer foreign keys.
@@ 1266-1275 (lines=10) @@
1263
     *
1264
     * @param Schema $schema
1265
     */
1266
    protected function addOrocrmMagentoProductForeignKeys(Schema $schema)
1267
    {
1268
        $table = $schema->getTable('orocrm_magento_product');
1269
        $table->addForeignKeyConstraint(
1270
            $schema->getTable('oro_integration_channel'),
1271
            ['channel_id'],
1272
            ['id'],
1273
            ['onDelete' => 'SET NULL']
1274
        );
1275
    }
1276
1277
    /**
1278
     * Add orocrm_magento_prod_to_website foreign keys.
@@ 1304-1313 (lines=10) @@
1301
     *
1302
     * @param Schema $schema
1303
     */
1304
    protected function addOrocrmMagentoWebsiteForeignKeys(Schema $schema)
1305
    {
1306
        $table = $schema->getTable('orocrm_magento_website');
1307
        $table->addForeignKeyConstraint(
1308
            $schema->getTable('oro_integration_channel'),
1309
            ['channel_id'],
1310
            ['id'],
1311
            ['onDelete' => 'SET NULL']
1312
        );
1313
    }
1314
1315
    /**
1316
     * Add orocrm_magento_cart foreign keys.