@@ -122,27 +122,27 @@ discard block |
||
122 | 122 | $behaviors = $tableMap->getBehaviors(); |
123 | 123 | foreach ($map::getFieldNames() as $field) { |
124 | 124 | $fDto = self::parseFormField($domain, $tableMap, $field, $behaviors); |
125 | - if(null !== $fDto) { |
|
125 | + if (null !== $fDto) { |
|
126 | 126 | $form->addField($fDto); |
127 | 127 | } |
128 | 128 | } |
129 | 129 | |
130 | - if(array_key_exists('i18n', $behaviors)) { |
|
131 | - $relateI18n = $tableMap->getRelation($tableMap->getPhpName() . 'I18n'); |
|
132 | - if(null !== $relateI18n) { |
|
130 | + if (array_key_exists('i18n', $behaviors)) { |
|
131 | + $relateI18n = $tableMap->getRelation($tableMap->getPhpName().'I18n'); |
|
132 | + if (null !== $relateI18n) { |
|
133 | 133 | $i18NTableMap = $relateI18n->getLocalTable(); |
134 | - foreach($i18NTableMap->getColumns() as $columnMap) { |
|
134 | + foreach ($i18NTableMap->getColumns() as $columnMap) { |
|
135 | 135 | $columnName = self::getColumnMapName($columnMap); |
136 | - if(!$form->fieldExists($columnName)) { |
|
136 | + if (!$form->fieldExists($columnName)) { |
|
137 | 137 | /** @var Field $fDto */ |
138 | 138 | $fDto = self::parseFormField($domain, $i18NTableMap, $columnMap->getPhpName(), $i18NTableMap->getBehaviors()); |
139 | - if(null !== $fDto) { |
|
139 | + if (null !== $fDto) { |
|
140 | 140 | $fDto->pk = false; |
141 | 141 | $fDto->required = true; |
142 | - if(strtolower($fDto->name) === 'locale') { |
|
142 | + if (strtolower($fDto->name) === 'locale') { |
|
143 | 143 | $fDto->type = Field::COMBO_TYPE; |
144 | 144 | $languages = explode(',', Config::getParam('i18n.locales', Config::getParam('default.language', 'es_ES'))); |
145 | - foreach($languages as $language) { |
|
145 | + foreach ($languages as $language) { |
|
146 | 146 | $fDto->data[] = [ |
147 | 147 | 'Type' => $language, |
148 | 148 | 'Label' => t($language), |
@@ -169,14 +169,14 @@ discard block |
||
169 | 169 | { |
170 | 170 | $column = null; |
171 | 171 | try { |
172 | - foreach($tableMap->getColumns() as $tableMapColumn) { |
|
172 | + foreach ($tableMap->getColumns() as $tableMapColumn) { |
|
173 | 173 | $columnName = $tableMapColumn->getPhpName(); |
174 | - if(preg_match('/^'.$field.'$/i', $columnName)) { |
|
174 | + if (preg_match('/^'.$field.'$/i', $columnName)) { |
|
175 | 175 | $column = $tableMapColumn; |
176 | 176 | break; |
177 | 177 | } |
178 | 178 | } |
179 | - } catch (\Exception $e) { |
|
179 | + }catch (\Exception $e) { |
|
180 | 180 | Logger::log($e->getMessage(), LOG_DEBUG); |
181 | 181 | } |
182 | 182 | return $column; |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | */ |
188 | 188 | public static function getFieldTypes() { |
189 | 189 | $configType = Config::getParam('api.field.case', TableMap::TYPE_PHPNAME); |
190 | - switch($configType) { |
|
190 | + switch ($configType) { |
|
191 | 191 | default: |
192 | 192 | case 'UpperCamelCase': |
193 | 193 | case TableMap::TYPE_PHPNAME: |