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

@@ 984-993 (lines=10) @@
981
     *
982
     * @param Schema $schema
983
     */
984
    protected function addOrocrmMagentoCustomerGroupForeignKeys(Schema $schema)
985
    {
986
        $table = $schema->getTable('orocrm_magento_customer_group');
987
        $table->addForeignKeyConstraint(
988
            $schema->getTable('oro_integration_channel'),
989
            ['channel_id'],
990
            ['id'],
991
            ['onDelete' => 'SET NULL']
992
        );
993
    }
994
995
    /**
996
     * Add orocrm_magento_customer foreign keys.
@@ 1220-1229 (lines=10) @@
1217
     *
1218
     * @param Schema $schema
1219
     */
1220
    protected function addOrocrmMagentoProductForeignKeys(Schema $schema)
1221
    {
1222
        $table = $schema->getTable('orocrm_magento_product');
1223
        $table->addForeignKeyConstraint(
1224
            $schema->getTable('oro_integration_channel'),
1225
            ['channel_id'],
1226
            ['id'],
1227
            ['onDelete' => 'SET NULL']
1228
        );
1229
    }
1230
1231
    /**
1232
     * Add orocrm_magento_prod_to_website foreign keys.
@@ 1258-1267 (lines=10) @@
1255
     *
1256
     * @param Schema $schema
1257
     */
1258
    protected function addOrocrmMagentoWebsiteForeignKeys(Schema $schema)
1259
    {
1260
        $table = $schema->getTable('orocrm_magento_website');
1261
        $table->addForeignKeyConstraint(
1262
            $schema->getTable('oro_integration_channel'),
1263
            ['channel_id'],
1264
            ['id'],
1265
            ['onDelete' => 'SET NULL']
1266
        );
1267
    }
1268
1269
    /**
1270
     * Add orocrm_magento_cart foreign keys.