@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | { |
17 | 17 | protected function createControl($container, $column, $record) |
18 | 18 | { |
19 | - switch(strtolower($column->getDbType())) |
|
19 | + switch (strtolower($column->getDbType())) |
|
20 | 20 | { |
21 | 21 | case 'boolean': |
22 | 22 | return $this->createBooleanControl($container, $column, $record); |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | protected function getControlValue($container, $column, $record) |
44 | 44 | { |
45 | - switch(strtolower($column->getDbType())) |
|
45 | + switch (strtolower($column->getDbType())) |
|
46 | 46 | { |
47 | 47 | case 'boolean': |
48 | 48 | return $container->findControl(self::DEFAULT_ID)->getChecked(); |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | { |
64 | 64 | $control = parent::createDateControl($container, $column, $record); |
65 | 65 | $value = $this->getRecordPropertyValue($column, $record); |
66 | - if(!empty($value) && preg_match('/timestamp/i', $column->getDbType())) |
|
66 | + if (!empty($value) && preg_match('/timestamp/i', $column->getDbType())) |
|
67 | 67 | $control->setTimestamp(intval($value)); |
68 | 68 | return $control; |
69 | 69 | } |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | { |
73 | 73 | $value = $this->getRecordPropertyValue($column, $record); |
74 | 74 | $time = parent::createDateTimeControl($container, $column, $record); |
75 | - if(!empty($value) && preg_match('/timestamp/i', $column->getDbType())) |
|
75 | + if (!empty($value) && preg_match('/timestamp/i', $column->getDbType())) |
|
76 | 76 | { |
77 | 77 | $dt = new \DateTime; |
78 | 78 | $dt->setTimestamp(intval($value)); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | |
86 | 86 | protected function getDateTimeValue($container, $column, $record) |
87 | 87 | { |
88 | - if(preg_match('/timestamp/i', $column->getDbType())) |
|
88 | + if (preg_match('/timestamp/i', $column->getDbType())) |
|
89 | 89 | { |
90 | 90 | $time = $container->findControl(self::DEFAULT_ID)->getTimestamp(); |
91 | 91 | $dt = new \DateTime; |
@@ -63,8 +63,9 @@ discard block |
||
63 | 63 | { |
64 | 64 | $control = parent::createDateControl($container, $column, $record); |
65 | 65 | $value = $this->getRecordPropertyValue($column, $record); |
66 | - if(!empty($value) && preg_match('/timestamp/i', $column->getDbType())) |
|
67 | - $control->setTimestamp(intval($value)); |
|
66 | + if(!empty($value) && preg_match('/timestamp/i', $column->getDbType())) { |
|
67 | + $control->setTimestamp(intval($value)); |
|
68 | + } |
|
68 | 69 | return $control; |
69 | 70 | } |
70 | 71 | |
@@ -101,9 +102,9 @@ discard block |
||
101 | 102 | $dt->format('j'), |
102 | 103 | $dt->format('Y') |
103 | 104 | ); |
105 | + } else { |
|
106 | + return parent::getDateTimeValue($container, $column, $record); |
|
104 | 107 | } |
105 | - else |
|
106 | - return parent::getDateTimeValue($container, $column, $record); |
|
107 | 108 | } |
108 | 109 | } |
109 | 110 |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | { |
18 | 18 | protected function createControl($container, $column, $record) |
19 | 19 | { |
20 | - switch(strtolower($column->getDbType())) |
|
20 | + switch (strtolower($column->getDbType())) |
|
21 | 21 | { |
22 | 22 | case 'boolean': |
23 | 23 | return $this->createBooleanControl($container, $column, $record); |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | |
41 | 41 | protected function getControlValue($container, $column, $record) |
42 | 42 | { |
43 | - switch(strtolower($column->getDbType())) |
|
43 | + switch (strtolower($column->getDbType())) |
|
44 | 44 | { |
45 | 45 | case 'boolean': |
46 | 46 | return $container->findControl(self::DEFAULT_ID)->getChecked(); |
@@ -27,24 +27,24 @@ discard block |
||
27 | 27 | { |
28 | 28 | $record->getDbConnection()->setActive(true); //must be connected before retrieving driver name! |
29 | 29 | $driver = $record->getDbConnection()->getDriverName(); |
30 | - switch(strtolower($driver)) |
|
30 | + switch (strtolower($driver)) |
|
31 | 31 | { |
32 | 32 | case 'sqlite': //sqlite 3 |
33 | 33 | case 'sqlite2': //sqlite 2 |
34 | - require_once(dirname(__FILE__) . '/TSqliteScaffoldInput.php'); |
|
34 | + require_once(dirname(__FILE__).'/TSqliteScaffoldInput.php'); |
|
35 | 35 | return new TSqliteScaffoldInput($conn); |
36 | 36 | case 'mysqli': |
37 | 37 | case 'mysql': |
38 | - require_once(dirname(__FILE__) . '/TMysqlScaffoldInput.php'); |
|
38 | + require_once(dirname(__FILE__).'/TMysqlScaffoldInput.php'); |
|
39 | 39 | return new TMysqlScaffoldInput($conn); |
40 | 40 | case 'pgsql': |
41 | - require_once(dirname(__FILE__) . '/TPgsqlScaffoldInput.php'); |
|
41 | + require_once(dirname(__FILE__).'/TPgsqlScaffoldInput.php'); |
|
42 | 42 | return new TPgsqlScaffoldInput($conn); |
43 | 43 | case 'mssql': |
44 | - require_once(dirname(__FILE__) . '/TMssqlScaffoldInput.php'); |
|
44 | + require_once(dirname(__FILE__).'/TMssqlScaffoldInput.php'); |
|
45 | 45 | return new TMssqlScaffoldInput($conn); |
46 | 46 | case 'ibm': |
47 | - require_once(dirname(__FILE__) . '/TIbmScaffoldInput.php'); |
|
47 | + require_once(dirname(__FILE__).'/TIbmScaffoldInput.php'); |
|
48 | 48 | return new TIbmScaffoldInput($conn); |
49 | 49 | default: |
50 | 50 | throw new TConfigurationException( |
@@ -57,13 +57,13 @@ discard block |
||
57 | 57 | $this->_parent = $parent; |
58 | 58 | $item->setCustomData($column->getColumnId()); |
59 | 59 | $this->createControl($item->_input, $column, $record); |
60 | - if($item->_input->findControl(self::DEFAULT_ID)) |
|
60 | + if ($item->_input->findControl(self::DEFAULT_ID)) |
|
61 | 61 | $this->createControlLabel($item->_label, $column, $record); |
62 | 62 | } |
63 | 63 | |
64 | 64 | protected function createControlLabel($label, $column, $record) |
65 | 65 | { |
66 | - $fieldname = ucwords(str_replace('_', ' ', $column->getColumnId())) . ':'; |
|
66 | + $fieldname = ucwords(str_replace('_', ' ', $column->getColumnId())).':'; |
|
67 | 67 | $label->setText($fieldname); |
68 | 68 | $label->setForControl(self::DEFAULT_ID); |
69 | 69 | } |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | public function loadScaffoldInput($parent, $item, $column, $record) |
72 | 72 | { |
73 | 73 | $this->_parent = $parent; |
74 | - if($this->getIsEnabled($column, $record)) |
|
74 | + if ($this->getIsEnabled($column, $record)) |
|
75 | 75 | { |
76 | 76 | $prop = $column->getColumnId(); |
77 | 77 | $record->setColumnValue($prop, $this->getControlValue($item->_input, $column, $record)); |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | protected function getRecordPropertyValue($column, $record) |
88 | 88 | { |
89 | 89 | $value = $record->getColumnValue($column->getColumnId()); |
90 | - if($column->getDefaultValue() !== TDbTableColumn::UNDEFINED_VALUE && $value === null) |
|
90 | + if ($column->getDefaultValue() !== TDbTableColumn::UNDEFINED_VALUE && $value === null) |
|
91 | 91 | return $column->getDefaultValue(); |
92 | 92 | else |
93 | 93 | return $value; |
@@ -57,8 +57,9 @@ discard block |
||
57 | 57 | $this->_parent = $parent; |
58 | 58 | $item->setCustomData($column->getColumnId()); |
59 | 59 | $this->createControl($item->_input, $column, $record); |
60 | - if($item->_input->findControl(self::DEFAULT_ID)) |
|
61 | - $this->createControlLabel($item->_label, $column, $record); |
|
60 | + if($item->_input->findControl(self::DEFAULT_ID)) { |
|
61 | + $this->createControlLabel($item->_label, $column, $record); |
|
62 | + } |
|
62 | 63 | } |
63 | 64 | |
64 | 65 | protected function createControlLabel($label, $column, $record) |
@@ -87,10 +88,11 @@ discard block |
||
87 | 88 | protected function getRecordPropertyValue($column, $record) |
88 | 89 | { |
89 | 90 | $value = $record->getColumnValue($column->getColumnId()); |
90 | - if($column->getDefaultValue() !== TDbTableColumn::UNDEFINED_VALUE && $value === null) |
|
91 | - return $column->getDefaultValue(); |
|
92 | - else |
|
93 | - return $value; |
|
91 | + if($column->getDefaultValue() !== TDbTableColumn::UNDEFINED_VALUE && $value === null) { |
|
92 | + return $column->getDefaultValue(); |
|
93 | + } else { |
|
94 | + return $value; |
|
95 | + } |
|
94 | 96 | } |
95 | 97 | |
96 | 98 | protected function setRecordPropertyValue($item, $record, $input) |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | { |
18 | 18 | protected function createControl($container, $column, $record) |
19 | 19 | { |
20 | - switch(strtolower($column->getDbType())) |
|
20 | + switch (strtolower($column->getDbType())) |
|
21 | 21 | { |
22 | 22 | case 'bit': |
23 | 23 | return $this->createBooleanControl($container, $column, $record); |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | return $this->createDateTimeControl($container, $column, $record); |
32 | 32 | default: |
33 | 33 | $control = $this->createDefaultControl($container, $column, $record); |
34 | - if($column->getIsExcluded()) |
|
34 | + if ($column->getIsExcluded()) |
|
35 | 35 | $control->setEnabled(false); |
36 | 36 | return $control; |
37 | 37 | } |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | protected function getControlValue($container, $column, $record) |
41 | 41 | { |
42 | - switch(strtolower($column->getDbType())) |
|
42 | + switch (strtolower($column->getDbType())) |
|
43 | 43 | { |
44 | 44 | case 'boolean': |
45 | 45 | return $container->findControl(self::DEFAULT_ID)->getChecked(); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | return $this->getDateTimeValue($container, $column, $record); |
48 | 48 | default: |
49 | 49 | $value = $this->getDefaultControlValue($container, $column, $record); |
50 | - if(trim($value) === '' && $column->getAllowNull()) |
|
50 | + if (trim($value) === '' && $column->getAllowNull()) |
|
51 | 51 | return null; |
52 | 52 | else |
53 | 53 | return $value; |
@@ -31,8 +31,9 @@ discard block |
||
31 | 31 | return $this->createDateTimeControl($container, $column, $record); |
32 | 32 | default: |
33 | 33 | $control = $this->createDefaultControl($container, $column, $record); |
34 | - if($column->getIsExcluded()) |
|
35 | - $control->setEnabled(false); |
|
34 | + if($column->getIsExcluded()) { |
|
35 | + $control->setEnabled(false); |
|
36 | + } |
|
36 | 37 | return $control; |
37 | 38 | } |
38 | 39 | } |
@@ -47,10 +48,11 @@ discard block |
||
47 | 48 | return $this->getDateTimeValue($container, $column, $record); |
48 | 49 | default: |
49 | 50 | $value = $this->getDefaultControlValue($container, $column, $record); |
50 | - if(trim($value) === '' && $column->getAllowNull()) |
|
51 | - return null; |
|
52 | - else |
|
53 | - return $value; |
|
51 | + if(trim($value) === '' && $column->getAllowNull()) { |
|
52 | + return null; |
|
53 | + } else { |
|
54 | + return $value; |
|
55 | + } |
|
54 | 56 | } |
55 | 57 | } |
56 | 58 | } |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function onLoad($param) |
66 | 66 | { |
67 | - if($this->getVisible()) |
|
67 | + if ($this->getVisible()) |
|
68 | 68 | $this->initializeEditForm(); |
69 | 69 | } |
70 | 70 | |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | { |
118 | 118 | $record = $this->getCurrentRecord(); |
119 | 119 | $classPath = $this->getEditRenderer(); |
120 | - if($classPath === '') |
|
120 | + if ($classPath === '') |
|
121 | 121 | { |
122 | 122 | $columns = $this->getTableInfo()->getColumns(); |
123 | 123 | $this->getInputRepeater()->setDataSource($columns); |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | } |
126 | 126 | else |
127 | 127 | { |
128 | - if($this->_editRenderer === null) |
|
128 | + if ($this->_editRenderer === null) |
|
129 | 129 | $this->createEditRenderer($record, $classPath); |
130 | 130 | else |
131 | 131 | $this->_editRenderer->setData($record); |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | protected function createEditRenderer($record, $classPath) |
143 | 143 | { |
144 | 144 | $this->_editRenderer = Prado::createComponent($classPath); |
145 | - if($this->_editRenderer instanceof IScaffoldEditRenderer) |
|
145 | + if ($this->_editRenderer instanceof IScaffoldEditRenderer) |
|
146 | 146 | { |
147 | 147 | $index = $this->getControls()->remove($this->getInputRepeater()); |
148 | 148 | $this->getControls()->insertAt($index, $this->_editRenderer); |
@@ -161,11 +161,11 @@ discard block |
||
161 | 161 | protected function createRepeaterEditItem($sender, $param) |
162 | 162 | { |
163 | 163 | $type = $param->getItem()->getItemType(); |
164 | - if($type == TListItemType::Item || $type == TListItemType::AlternatingItem) |
|
164 | + if ($type == TListItemType::Item || $type == TListItemType::AlternatingItem) |
|
165 | 165 | { |
166 | 166 | $item = $param->getItem(); |
167 | 167 | $column = $item->getData(); |
168 | - if($column === null) |
|
168 | + if ($column === null) |
|
169 | 169 | return; |
170 | 170 | |
171 | 171 | $record = $this->getCurrentRecord(); |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | */ |
181 | 181 | public function bubbleEvent($sender, $param) |
182 | 182 | { |
183 | - switch(strtolower($param->getCommandName())) |
|
183 | + switch (strtolower($param->getCommandName())) |
|
184 | 184 | { |
185 | 185 | case 'save': |
186 | 186 | return $this->doSave() ? false : true; |
@@ -199,14 +199,14 @@ discard block |
||
199 | 199 | */ |
200 | 200 | protected function doSave() |
201 | 201 | { |
202 | - if($this->getPage()->getIsValid()) |
|
202 | + if ($this->getPage()->getIsValid()) |
|
203 | 203 | { |
204 | 204 | $record = $this->getCurrentRecord(); |
205 | - if($this->_editRenderer === null) |
|
205 | + if ($this->_editRenderer === null) |
|
206 | 206 | { |
207 | 207 | $table = $this->getTableInfo(); |
208 | 208 | $builder = $this->getScaffoldInputBuilder($record); |
209 | - foreach($this->getInputRepeater()->getItems() as $item) |
|
209 | + foreach ($this->getInputRepeater()->getItems() as $item) |
|
210 | 210 | { |
211 | 211 | $column = $table->getColumn($item->getCustomData()); |
212 | 212 | $builder->loadScaffoldInput($this, $item, $column, $record); |
@@ -219,7 +219,7 @@ discard block |
||
219 | 219 | $record->save(); |
220 | 220 | return true; |
221 | 221 | } |
222 | - elseif($this->_editRenderer !== null) |
|
222 | + elseif ($this->_editRenderer !== null) |
|
223 | 223 | { |
224 | 224 | //preserve the form data. |
225 | 225 | $this->_editRenderer->updateRecord($this->getCurrentRecord()); |
@@ -273,7 +273,7 @@ discard block |
||
273 | 273 | { |
274 | 274 | static $_builders = []; |
275 | 275 | $class = get_class($record); |
276 | - if(!isset($_builders[$class])) |
|
276 | + if (!isset($_builders[$class])) |
|
277 | 277 | { |
278 | 278 | $_builders[$class] = TScaffoldInputBase::createInputBuilder($record); |
279 | 279 | } |
@@ -285,6 +285,6 @@ discard block |
||
285 | 285 | */ |
286 | 286 | public function getValidationGroup() |
287 | 287 | { |
288 | - return 'group_' . $this->getUniqueID(); |
|
288 | + return 'group_'.$this->getUniqueID(); |
|
289 | 289 | } |
290 | 290 | } |
291 | 291 | \ No newline at end of file |
@@ -64,8 +64,9 @@ discard block |
||
64 | 64 | */ |
65 | 65 | public function onLoad($param) |
66 | 66 | { |
67 | - if($this->getVisible()) |
|
68 | - $this->initializeEditForm(); |
|
67 | + if($this->getVisible()) { |
|
68 | + $this->initializeEditForm(); |
|
69 | + } |
|
69 | 70 | } |
70 | 71 | |
71 | 72 | /** |
@@ -122,13 +123,13 @@ discard block |
||
122 | 123 | $columns = $this->getTableInfo()->getColumns(); |
123 | 124 | $this->getInputRepeater()->setDataSource($columns); |
124 | 125 | $this->getInputRepeater()->dataBind(); |
125 | - } |
|
126 | - else |
|
126 | + } else |
|
127 | 127 | { |
128 | - if($this->_editRenderer === null) |
|
129 | - $this->createEditRenderer($record, $classPath); |
|
130 | - else |
|
131 | - $this->_editRenderer->setData($record); |
|
128 | + if($this->_editRenderer === null) { |
|
129 | + $this->createEditRenderer($record, $classPath); |
|
130 | + } else { |
|
131 | + $this->_editRenderer->setData($record); |
|
132 | + } |
|
132 | 133 | } |
133 | 134 | } |
134 | 135 | |
@@ -147,8 +148,7 @@ discard block |
||
147 | 148 | $index = $this->getControls()->remove($this->getInputRepeater()); |
148 | 149 | $this->getControls()->insertAt($index, $this->_editRenderer); |
149 | 150 | $this->_editRenderer->setData($record); |
150 | - } |
|
151 | - else |
|
151 | + } else |
|
152 | 152 | { |
153 | 153 | throw new TConfigurationException( |
154 | 154 | 'scaffold_invalid_edit_renderer', $this->getID(), get_class($record)); |
@@ -165,8 +165,9 @@ discard block |
||
165 | 165 | { |
166 | 166 | $item = $param->getItem(); |
167 | 167 | $column = $item->getData(); |
168 | - if($column === null) |
|
169 | - return; |
|
168 | + if($column === null) { |
|
169 | + return; |
|
170 | + } |
|
170 | 171 | |
171 | 172 | $record = $this->getCurrentRecord(); |
172 | 173 | $builder = $this->getScaffoldInputBuilder($record); |
@@ -211,15 +212,13 @@ discard block |
||
211 | 212 | $column = $table->getColumn($item->getCustomData()); |
212 | 213 | $builder->loadScaffoldInput($this, $item, $column, $record); |
213 | 214 | } |
214 | - } |
|
215 | - else |
|
215 | + } else |
|
216 | 216 | { |
217 | 217 | $this->_editRenderer->updateRecord($record); |
218 | 218 | } |
219 | 219 | $record->save(); |
220 | 220 | return true; |
221 | - } |
|
222 | - elseif($this->_editRenderer !== null) |
|
221 | + } elseif($this->_editRenderer !== null) |
|
223 | 222 | { |
224 | 223 | //preserve the form data. |
225 | 224 | $this->_editRenderer->updateRecord($this->getCurrentRecord()); |
@@ -92,7 +92,7 @@ |
||
92 | 92 | */ |
93 | 93 | public function bubbleEvent($sender, $param) |
94 | 94 | { |
95 | - switch(strtolower($param->getCommandName())) |
|
95 | + switch (strtolower($param->getCommandName())) |
|
96 | 96 | { |
97 | 97 | case 'edit': |
98 | 98 | return $this->showEditView($sender, $param); |
@@ -47,10 +47,10 @@ discard block |
||
47 | 47 | */ |
48 | 48 | protected function getListView() |
49 | 49 | { |
50 | - if($this->_list === null && ($id = $this->getListViewID()) !== null) |
|
50 | + if ($this->_list === null && ($id = $this->getListViewID()) !== null) |
|
51 | 51 | { |
52 | 52 | $this->_list = $this->getParent()->findControl($id); |
53 | - if($this->_list === null) |
|
53 | + if ($this->_list === null) |
|
54 | 54 | throw new TConfigurationException('scaffold_unable_to_find_list_view', $id); |
55 | 55 | } |
56 | 56 | return $this->_list; |
@@ -78,9 +78,9 @@ discard block |
||
78 | 78 | */ |
79 | 79 | public function bubbleEvent($sender, $param) |
80 | 80 | { |
81 | - if(strtolower($param->getCommandName()) === 'search') |
|
81 | + if (strtolower($param->getCommandName()) === 'search') |
|
82 | 82 | { |
83 | - if(($list = $this->getListView()) !== null) |
|
83 | + if (($list = $this->getListView()) !== null) |
|
84 | 84 | { |
85 | 85 | $list->setSearchCondition($this->createSearchCondition()); |
86 | 86 | return false; |
@@ -96,7 +96,7 @@ discard block |
||
96 | 96 | protected function createSearchCondition() |
97 | 97 | { |
98 | 98 | $table = $this->getTableInfo(); |
99 | - if(strlen($str = $this->getSearchText()->getText()) > 0) |
|
99 | + if (strlen($str = $this->getSearchText()->getText()) > 0) |
|
100 | 100 | { |
101 | 101 | $builder = $table->createCommandBuilder($this->getRecordFinder()->getDbConnection()); |
102 | 102 | return $builder->getSearchExpression($this->getFields(), $str); |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | */ |
109 | 109 | protected function getFields() |
110 | 110 | { |
111 | - if(strlen(trim($str = $this->getSearchableFields())) > 0) |
|
111 | + if (strlen(trim($str = $this->getSearchableFields())) > 0) |
|
112 | 112 | $fields = preg_split('/\s*,\s*/', $str); |
113 | 113 | else |
114 | 114 | $fields = $this->getTableInfo()->getColumns()->getKeys(); |
@@ -50,8 +50,9 @@ discard block |
||
50 | 50 | if($this->_list === null && ($id = $this->getListViewID()) !== null) |
51 | 51 | { |
52 | 52 | $this->_list = $this->getParent()->findControl($id); |
53 | - if($this->_list === null) |
|
54 | - throw new TConfigurationException('scaffold_unable_to_find_list_view', $id); |
|
53 | + if($this->_list === null) { |
|
54 | + throw new TConfigurationException('scaffold_unable_to_find_list_view', $id); |
|
55 | + } |
|
55 | 56 | } |
56 | 57 | return $this->_list; |
57 | 58 | } |
@@ -108,10 +109,11 @@ discard block |
||
108 | 109 | */ |
109 | 110 | protected function getFields() |
110 | 111 | { |
111 | - if(strlen(trim($str = $this->getSearchableFields())) > 0) |
|
112 | - $fields = preg_split('/\s*,\s*/', $str); |
|
113 | - else |
|
114 | - $fields = $this->getTableInfo()->getColumns()->getKeys(); |
|
112 | + if(strlen(trim($str = $this->getSearchableFields())) > 0) { |
|
113 | + $fields = preg_split('/\s*,\s*/', $str); |
|
114 | + } else { |
|
115 | + $fields = $this->getTableInfo()->getColumns()->getKeys(); |
|
116 | + } |
|
115 | 117 | return $fields; |
116 | 118 | } |
117 | 119 |
@@ -96,9 +96,9 @@ discard block |
||
96 | 96 | public static function getInstance($self = null) |
97 | 97 | { |
98 | 98 | static $instance; |
99 | - if($self !== null) |
|
99 | + if ($self !== null) |
|
100 | 100 | $instance = $self; |
101 | - elseif($instance === null) |
|
101 | + elseif ($instance === null) |
|
102 | 102 | $instance = new self; |
103 | 103 | return $instance; |
104 | 104 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | */ |
109 | 109 | public function getRecordGateway() |
110 | 110 | { |
111 | - if($this->_gateway === null) { |
|
111 | + if ($this->_gateway === null) { |
|
112 | 112 | $this->_gateway = $this->createRecordGateway(); |
113 | 113 | } |
114 | 114 | return $this->_gateway; |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | public function setGatewayClass($value) |
130 | 130 | { |
131 | 131 | $this->_gateway = null; |
132 | - $this->_gatewayClass = (string)$value; |
|
132 | + $this->_gatewayClass = (string) $value; |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | /** |
@@ -96,10 +96,11 @@ |
||
96 | 96 | public static function getInstance($self = null) |
97 | 97 | { |
98 | 98 | static $instance; |
99 | - if($self !== null) |
|
100 | - $instance = $self; |
|
101 | - elseif($instance === null) |
|
102 | - $instance = new self; |
|
99 | + if($self !== null) { |
|
100 | + $instance = $self; |
|
101 | + } elseif($instance === null) { |
|
102 | + $instance = new self; |
|
103 | + } |
|
103 | 104 | return $instance; |
104 | 105 | } |
105 | 106 |
@@ -30,9 +30,9 @@ |
||
30 | 30 | { |
31 | 31 | $lang = Prado::getPreferredLanguage(); |
32 | 32 | $path = dirname(__FILE__); |
33 | - $msgFile = $path . '/messages-' . $lang . '.txt'; |
|
34 | - if(!is_file($msgFile)) |
|
35 | - $msgFile = $path . '/messages.txt'; |
|
33 | + $msgFile = $path.'/messages-'.$lang.'.txt'; |
|
34 | + if (!is_file($msgFile)) |
|
35 | + $msgFile = $path.'/messages.txt'; |
|
36 | 36 | return $msgFile; |
37 | 37 | } |
38 | 38 | } |
39 | 39 | \ No newline at end of file |
@@ -31,8 +31,9 @@ |
||
31 | 31 | $lang = Prado::getPreferredLanguage(); |
32 | 32 | $path = dirname(__FILE__); |
33 | 33 | $msgFile = $path . '/messages-' . $lang . '.txt'; |
34 | - if(!is_file($msgFile)) |
|
35 | - $msgFile = $path . '/messages.txt'; |
|
34 | + if(!is_file($msgFile)) { |
|
35 | + $msgFile = $path . '/messages.txt'; |
|
36 | + } |
|
36 | 37 | return $msgFile; |
37 | 38 | } |
38 | 39 | } |
39 | 40 | \ No newline at end of file |