@@ -4,26 +4,26 @@ |
||
4 | 4 | |
5 | 5 | class m170904_201142_dds_multichoice_creation extends Migration |
6 | 6 | { |
7 | - public function safeUp() |
|
8 | - { |
|
9 | - $sql =<<<EOQ |
|
7 | + public function safeUp() |
|
8 | + { |
|
9 | + $sql =<<<EOQ |
|
10 | 10 | SET foreign_key_checks = 0; |
11 | 11 | REPLACE INTO `dds_data_type` (`data_type_ref`, `label`, `description`, `definition`, `storage_ref`, `deleted`) |
12 | 12 | VALUES |
13 | 13 | ('choice_multiple','Multiple Choice','For storing multiple choice keys','{"size":10000}','text',0); |
14 | 14 | SET foreign_key_checks = 1; |
15 | 15 | EOQ; |
16 | - $this->execute($sql); |
|
16 | + $this->execute($sql); |
|
17 | 17 | |
18 | - } |
|
18 | + } |
|
19 | 19 | |
20 | - public function safeDown() |
|
21 | - { |
|
22 | - $sql =<<<EOQ |
|
20 | + public function safeDown() |
|
21 | + { |
|
22 | + $sql =<<<EOQ |
|
23 | 23 | SET foreign_key_checks=0; |
24 | 24 | DELETE FROM `dds_data_type` WHERE `data_type_ref`='choice_multiple'; |
25 | 25 | SET foreign_key_checks=1; |
26 | 26 | EOQ; |
27 | - $this->execute($sql); |
|
28 | - } |
|
27 | + $this->execute($sql); |
|
28 | + } |
|
29 | 29 | } |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | { |
7 | 7 | public function safeUp() |
8 | 8 | { |
9 | - $sql =<<<EOQ |
|
9 | + $sql = <<<EOQ |
|
10 | 10 | SET foreign_key_checks = 0; |
11 | 11 | REPLACE INTO `dds_data_type` (`data_type_ref`, `label`, `description`, `definition`, `storage_ref`, `deleted`) |
12 | 12 | VALUES |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | |
20 | 20 | public function safeDown() |
21 | 21 | { |
22 | - $sql =<<<EOQ |
|
22 | + $sql = <<<EOQ |
|
23 | 23 | SET foreign_key_checks=0; |
24 | 24 | DELETE FROM `dds_data_type` WHERE `data_type_ref`='choice_multiple'; |
25 | 25 | SET foreign_key_checks=1; |
@@ -4,9 +4,9 @@ discard block |
||
4 | 4 | |
5 | 5 | class m160913_121403__neon_dds_changes extends Migration |
6 | 6 | { |
7 | - // Use safeUp/safeDown to run migration code within a transaction |
|
8 | - public function safeUp() |
|
9 | - { |
|
7 | + // Use safeUp/safeDown to run migration code within a transaction |
|
8 | + public function safeUp() |
|
9 | + { |
|
10 | 10 | // add a series of default types to the datatypes |
11 | 11 | $sql =<<<EOQ |
12 | 12 | INSERT INTO `dds_data_type` (`data_type_ref`, `label`, `description`, `definition`, `storage_ref`, `deleted`) |
@@ -40,10 +40,10 @@ discard block |
||
40 | 40 | $command = $connection->createCommand($sql); |
41 | 41 | $command->execute(); |
42 | 42 | |
43 | - } |
|
43 | + } |
|
44 | 44 | |
45 | - public function safeDown() |
|
46 | - { |
|
45 | + public function safeDown() |
|
46 | + { |
|
47 | 47 | // delete the additional rows in the datatypes |
48 | 48 | $sql =<<<EOQ |
49 | 49 | DELETE FROM `dds_data_type` WHERE `data_type_ref` IN |
@@ -55,5 +55,5 @@ discard block |
||
55 | 55 | $command = $connection->createCommand($sql); |
56 | 56 | $command->execute(); |
57 | 57 | |
58 | - } |
|
58 | + } |
|
59 | 59 | } |
@@ -8,7 +8,7 @@ discard block |
||
8 | 8 | public function safeUp() |
9 | 9 | { |
10 | 10 | // add a series of default types to the datatypes |
11 | - $sql =<<<EOQ |
|
11 | + $sql = <<<EOQ |
|
12 | 12 | INSERT INTO `dds_data_type` (`data_type_ref`, `label`, `description`, `definition`, `storage_ref`, `deleted`) |
13 | 13 | VALUES |
14 | 14 | ('binary','Normal Binary','For normal binaries such as images up to 16MB in size','','binary',0), |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | public function safeDown() |
46 | 46 | { |
47 | 47 | // delete the additional rows in the datatypes |
48 | - $sql =<<<EOQ |
|
48 | + $sql = <<<EOQ |
|
49 | 49 | DELETE FROM `dds_data_type` WHERE `data_type_ref` IN |
50 | 50 | ('binary', 'binarylong', 'binaryshort', 'date', 'datetime', 'float', 'floatdouble', |
51 | 51 | 'integer', 'integerlong', 'integershort', 'integertiny', 'text', 'textlong', 'textshort', |
@@ -4,13 +4,13 @@ |
||
4 | 4 | |
5 | 5 | class m161130_132511_dds_uuid_change_to_22_chars extends Migration |
6 | 6 | { |
7 | - public function safeUp() |
|
8 | - { |
|
7 | + public function safeUp() |
|
8 | + { |
|
9 | 9 | $this->alterColumn('dds_object', '_uuid', "CHAR(22) NOT NULL COMMENT 'A universally unique identifier for this object'"); |
10 | - } |
|
10 | + } |
|
11 | 11 | |
12 | - public function safeDown() |
|
13 | - { |
|
12 | + public function safeDown() |
|
13 | + { |
|
14 | 14 | $this->alterColumn('dds_object', '_uuid', "CHAR(36) NOT NULL"); |
15 | - } |
|
15 | + } |
|
16 | 16 | } |
@@ -4,8 +4,8 @@ discard block |
||
4 | 4 | |
5 | 5 | class m161111_161448__dds_removal_of_ids extends Migration |
6 | 6 | { |
7 | - public function safeUp() |
|
8 | - { |
|
7 | + public function safeUp() |
|
8 | + { |
|
9 | 9 | // delete ids |
10 | 10 | $this->dropColumn('dds_class', 'id'); |
11 | 11 | $this->dropColumn('dds_data_type', 'id'); |
@@ -14,10 +14,10 @@ discard block |
||
14 | 14 | |
15 | 15 | // add a uuid to object tables |
16 | 16 | $this->execute('ALTER TABLE `dds_object` ADD `_uuid` CHAR(36) NOT NULL FIRST, ADD PRIMARY KEY (`_uuid`)'); |
17 | - } |
|
17 | + } |
|
18 | 18 | |
19 | - public function safeDown() |
|
20 | - { |
|
19 | + public function safeDown() |
|
20 | + { |
|
21 | 21 | // remove the uuid |
22 | 22 | $this->dropColumn('dds_object', '_uuid'); |
23 | 23 | // add ids back again |
@@ -25,5 +25,5 @@ discard block |
||
25 | 25 | $this->execute('ALTER TABLE `dds_data_type` ADD `id` INT UNSIGNED NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (`id`)'); |
26 | 26 | $this->execute('ALTER TABLE `dds_member` ADD `id` INT UNSIGNED NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (`id`)'); |
27 | 27 | $this->execute('ALTER TABLE `dds_object` ADD `_id` INT UNSIGNED NOT NULL AUTO_INCREMENT FIRST, ADD PRIMARY KEY (`_id`)'); |
28 | - } |
|
28 | + } |
|
29 | 29 | } |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | $connection = \Yii::$app->getDb(); |
16 | 16 | |
17 | 17 | // create the various tables for dds |
18 | - $sql=<<<EOQ |
|
18 | + $sql = <<<EOQ |
|
19 | 19 | -- -------------------------------------------------------- |
20 | 20 | |
21 | 21 | -- |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | $command = $connection->createCommand($sql); |
143 | 143 | $command->execute(); |
144 | 144 | |
145 | - $sql=<<<EOQ |
|
145 | + $sql = <<<EOQ |
|
146 | 146 | -- |
147 | 147 | -- Dumping data for table `dds_storage` |
148 | 148 | -- |
@@ -4,13 +4,13 @@ |
||
4 | 4 | |
5 | 5 | class m161018_154331__dds_add_definition_to_class extends Migration |
6 | 6 | { |
7 | - public function safeUp() |
|
8 | - { |
|
9 | - $this->addColumn('dds_class', 'definition', $this->text(10000) . " DEFAULT NULL COMMENT 'A definition for use by other modules, but not understood by DDS'"); |
|
10 | - } |
|
7 | + public function safeUp() |
|
8 | + { |
|
9 | + $this->addColumn('dds_class', 'definition', $this->text(10000) . " DEFAULT NULL COMMENT 'A definition for use by other modules, but not understood by DDS'"); |
|
10 | + } |
|
11 | 11 | |
12 | - public function safeDown() |
|
13 | - { |
|
14 | - $this->dropColumn('dds_class', 'definition'); |
|
15 | - } |
|
12 | + public function safeDown() |
|
13 | + { |
|
14 | + $this->dropColumn('dds_class', 'definition'); |
|
15 | + } |
|
16 | 16 | } |
@@ -6,7 +6,7 @@ |
||
6 | 6 | { |
7 | 7 | public function safeUp() |
8 | 8 | { |
9 | - $this->addColumn('dds_class', 'definition', $this->text(10000) . " DEFAULT NULL COMMENT 'A definition for use by other modules, but not understood by DDS'"); |
|
9 | + $this->addColumn('dds_class', 'definition', $this->text(10000)." DEFAULT NULL COMMENT 'A definition for use by other modules, but not understood by DDS'"); |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | public function safeDown() |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | * @param string $module which module this is for - e.g. dds or phoebe |
150 | 150 | * @return \neon\daedalus\interfaces\IDdsAppMigrator |
151 | 151 | */ |
152 | - public function getIDdsAppMigrator($module='dds') { |
|
152 | + public function getIDdsAppMigrator($module = 'dds') { |
|
153 | 153 | $factory = $this->get('DdsAppMigratorFactory'); |
154 | 154 | return $factory::createMigrator("@system/$module/migrations"); |
155 | 155 | } |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | /** |
198 | 198 | * @inheritdoc |
199 | 199 | */ |
200 | - public function getDataMap($key, $query='', $filters = [], $fields = [], $start = 0, $length = 100) |
|
200 | + public function getDataMap($key, $query = '', $filters = [], $fields = [], $start = 0, $length = 100) |
|
201 | 201 | { |
202 | 202 | if (is_string($query)) { |
203 | 203 | $filters['_map_field_'] = $query; |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | /** |
210 | 210 | * @inheritdoc |
211 | 211 | */ |
212 | - public function makeMapLookupRequest($key, $ids, $fields=[]) |
|
212 | + public function makeMapLookupRequest($key, $ids, $fields = []) |
|
213 | 213 | { |
214 | 214 | return $this->IDdsObjectMapManagement->makeMapLookupRequest($ids, $fields, $key); |
215 | 215 | } |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * @param boolean $refresh whther to refresh the cache before fetching this setting defaults to false |
25 | 25 | * @return string |
26 | 26 | */ |
27 | - public function get($app, $key, $default=null, $refresh=false); |
|
27 | + public function get($app, $key, $default = null, $refresh = false); |
|
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Set a setting value |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * @param boolean $refresh if true forces reftech fo the the settings |
45 | 45 | * @return array in the format @see self::$_settings |
46 | 46 | */ |
47 | - public function getSettings($refresh=false); |
|
47 | + public function getSettings($refresh = false); |
|
48 | 48 | |
49 | 49 | /** |
50 | 50 | * Load the settings from the database and cache for the session |
@@ -52,6 +52,6 @@ discard block |
||
52 | 52 | * @param boolean $refresh if true forces refresh values from the database |
53 | 53 | * @return array in the format @see self::$_settings |
54 | 54 | */ |
55 | - public function getAll($refresh=false); |
|
55 | + public function getAll($refresh = false); |
|
56 | 56 | |
57 | 57 | } |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | * @param boolean $refresh whether to refresh the cache before fetching this setting defaults to false |
50 | 50 | * @return string |
51 | 51 | */ |
52 | - public function get($app, $key, $default=null, $refresh=false) |
|
52 | + public function get($app, $key, $default = null, $refresh = false) |
|
53 | 53 | { |
54 | 54 | $settings = $this->getSettings($refresh); |
55 | 55 | return isset($settings[$app][$key]) && $settings[$app][$key] !== '' ? $settings[$app][$key] : $default; |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | $result = $setting->save(); |
78 | 78 | |
79 | 79 | if (!$result) { |
80 | - throw new \Exception('Unable to save setting. ' . print_r($setting->getErrors(), true)); |
|
80 | + throw new \Exception('Unable to save setting. '.print_r($setting->getErrors(), true)); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | $this->_settings[$app][$key] = $value; |
@@ -90,12 +90,12 @@ discard block |
||
90 | 90 | * @param boolean $refresh if true forces a reload of the the settings |
91 | 91 | * @return array in the format @see self::$_settings |
92 | 92 | */ |
93 | - public function getAll($refresh=false) |
|
93 | + public function getAll($refresh = false) |
|
94 | 94 | { |
95 | 95 | if ($this->_settings === null || $refresh) { |
96 | 96 | $this->_settings = []; |
97 | 97 | $settingRows = Setting::find()->asArray()->all(); |
98 | - foreach($settingRows as $setting) { |
|
98 | + foreach ($settingRows as $setting) { |
|
99 | 99 | $this->_settings[$setting['app']][$setting['key']] = $this->_decode($setting['value']); |
100 | 100 | } |
101 | 101 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | * @param boolean $refresh if true forces a reload of the the settings |
109 | 109 | * @return array in the format @see self::$_settings |
110 | 110 | */ |
111 | - public function getSettings($refresh=false) |
|
111 | + public function getSettings($refresh = false) |
|
112 | 112 | { |
113 | 113 | return $this->getAll($refresh); |
114 | 114 | } |