Completed
Push — master ( 108ec4...d39e2b )
by Aimeos
06:47
created

TablesAddTypo3TestData   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 5
Bugs 0 Features 0
Metric Value
wmc 2
eloc 6
c 5
b 0
f 0
dl 0
loc 25
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getPreDependencies() 0 3 1
A migrate() 0 9 1
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2015-2018
6
 */
7
8
9
namespace Aimeos\MW\Setup\Task;
10
11
12
/**
13
 * Creates all required TYPO3 tables.
14
 */
15
class TablesAddTypo3TestData extends TablesCreateMShop
16
{
17
	/**
18
	 * Returns the list of task names which this task depends on.
19
	 *
20
	 * @return string[] List of task names
21
	 */
22
	public function getPreDependencies() : array
23
	{
24
		return ['TablesCreateMShop'];
25
	}
26
27
28
	/**
29
	 * Creates the TYPO3 test tables
30
	 */
31
	public function migrate()
32
	{
33
		$this->msg( 'Creating TYPO3 test tables', 0, '' );
34
35
		$ds = DIRECTORY_SEPARATOR;
36
37
		$this->setupSchema( ['db-customer' => 'schema' . $ds . 'customer.php'] );
38
39
		$this->execute( "
40
			INSERT INTO `static_countries` (`pid`, `deleted`, `cn_iso_2`, `cn_iso_3`, `cn_iso_nr`, `cn_parent_tr_iso_nr`, `cn_official_name_local`, `cn_official_name_en`, `cn_capital`, `cn_tldomain`, `cn_currency_iso_3`, `cn_currency_iso_nr`, `cn_phone`, `cn_eu_member`, `cn_address_format`, `cn_zone_flag`, `cn_short_local`, `cn_short_en`, `cn_uno_member`)
41
			SELECT 0, 0, 'DE', 'DEU', 276, 155, 'Bundesrepublik Deutschland', 'Federal Republic of Germany', 'Berlin', 'de', 'EUR', 978, 49, 1, 1, 0, 'Deutschland', 'Germany', 1 FROM DUAL WHERE NOT EXISTS ( SELECT `cn_iso_2` FROM `static_countries` WHERE `cn_iso_2` = 'DE' );
42
		" );
43
	}
44
}
45