Completed
Push — 1.8 ( 8d6730...a2d9e7 )
by
unknown
42:28
created

createCallStatusTranslationTable()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 18
Code Lines 13

Duplication

Lines 18
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 18
loc 18
rs 9.4285
c 1
b 0
f 0
cc 1
eloc 13
nc 1
nop 1
1
<?php
2
3
namespace OroCRM\Bundle\CallBundle\Migrations\Schema\v1_6;
4
5
use Doctrine\DBAL\Schema\Schema;
6
7
use Oro\Bundle\MigrationBundle\Migration\Migration;
8
use Oro\Bundle\MigrationBundle\Migration\QueryBag;
9
10
class OroCRMCallBundle implements Migration
11
{
12
    /**
13
     * {@inheritdoc}
14
     */
15
    public function up(Schema $schema, QueryBag $queries)
16
    {
17
        self::createCallDirectionTranslationTable($schema);
18
        self::createCallStatusTranslationTable($schema);
19
    }
20
21
    /**
22
     * Generate table orocrm_call_direction_trans
23
     *
24
     * @param Schema $schema
25
     */
26 View Code Duplication
    public static function createCallDirectionTranslationTable(Schema $schema)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
27
    {
28
        /** Generate table orocrm_call_direction_trans **/
29
        $table = $schema->createTable('orocrm_call_direction_trans');
30
        $table->addColumn('id', 'integer', array('autoincrement' => true));
31
        $table->addColumn('foreign_key', 'string', array('length' => 32));
32
        $table->addColumn('content', 'string', array('length' => 255));
33
        $table->addColumn('locale', 'string', array('length' => 8));
34
        $table->addColumn('object_class', 'string', array('length' => 255));
35
        $table->addColumn('field', 'string', array('length' => 32));
36
        $table->setPrimaryKey(array('id'));
37
        $table->addIndex(
38
            array('locale', 'object_class', 'field', 'foreign_key'),
39
            'call_direction_translation_idx',
40
            array()
41
        );
42
        /** End of generate table orocrm_call_direction_trans **/
43
    }
44
45
    /**
46
     * Generate table orocrm_call_status_trans
47
     *
48
     * @param Schema $schema
49
     */
50 View Code Duplication
    public static function createCallStatusTranslationTable(Schema $schema)
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
51
    {
52
        /** Generate table orocrm_call_status_trans **/
53
        $table = $schema->createTable('orocrm_call_status_trans');
54
        $table->addColumn('id', 'integer', array('autoincrement' => true));
55
        $table->addColumn('foreign_key', 'string', array('length' => 32));
56
        $table->addColumn('content', 'string', array('length' => 255));
57
        $table->addColumn('locale', 'string', array('length' => 8));
58
        $table->addColumn('object_class', 'string', array('length' => 255));
59
        $table->addColumn('field', 'string', array('length' => 32));
60
        $table->setPrimaryKey(array('id'));
61
        $table->addIndex(
62
            array('locale', 'object_class', 'field', 'foreign_key'),
63
            'call_status_translation_idx',
64
            array()
65
        );
66
        /** End of generate table orocrm_call_status_trans **/
67
    }
68
}
69