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

@@ 1024-1033 (lines=10) @@
1021
     *
1022
     * @param Schema $schema
1023
     */
1024
    protected function addOrocrmMagentoCustomerGroupForeignKeys(Schema $schema)
1025
    {
1026
        $table = $schema->getTable('orocrm_magento_customer_group');
1027
        $table->addForeignKeyConstraint(
1028
            $schema->getTable('oro_integration_channel'),
1029
            ['channel_id'],
1030
            ['id'],
1031
            ['onDelete' => 'SET NULL']
1032
        );
1033
    }
1034
1035
    /**
1036
     * Add orocrm_magento_customer foreign keys.
@@ 1260-1269 (lines=10) @@
1257
     *
1258
     * @param Schema $schema
1259
     */
1260
    protected function addOrocrmMagentoProductForeignKeys(Schema $schema)
1261
    {
1262
        $table = $schema->getTable('orocrm_magento_product');
1263
        $table->addForeignKeyConstraint(
1264
            $schema->getTable('oro_integration_channel'),
1265
            ['channel_id'],
1266
            ['id'],
1267
            ['onDelete' => 'SET NULL']
1268
        );
1269
    }
1270
1271
    /**
1272
     * Add orocrm_magento_prod_to_website foreign keys.
@@ 1298-1307 (lines=10) @@
1295
     *
1296
     * @param Schema $schema
1297
     */
1298
    protected function addOrocrmMagentoWebsiteForeignKeys(Schema $schema)
1299
    {
1300
        $table = $schema->getTable('orocrm_magento_website');
1301
        $table->addForeignKeyConstraint(
1302
            $schema->getTable('oro_integration_channel'),
1303
            ['channel_id'],
1304
            ['id'],
1305
            ['onDelete' => 'SET NULL']
1306
        );
1307
    }
1308
1309
    /**
1310
     * Add orocrm_magento_cart foreign keys.