@@ -92,13 +92,13 @@ discard block |
||
92 | 92 | */ |
93 | 93 | protected function collectForeignObjects(&$results) |
94 | 94 | { |
95 | - $fkeys = $this->getRelationForeignKeys(); |
|
96 | - $properties = array_values($fkeys); |
|
97 | - $fields = array_keys($fkeys); |
|
95 | + $fkeys=$this->getRelationForeignKeys(); |
|
96 | + $properties=array_values($fkeys); |
|
97 | + $fields=array_keys($fkeys); |
|
98 | 98 | |
99 | - $indexValues = $this->getIndexValues($properties, $results); |
|
100 | - $fkObjects = $this->findForeignObjects($fields,$indexValues); |
|
101 | - $this->populateResult($results,$properties,$fkObjects,$fields); |
|
99 | + $indexValues=$this->getIndexValues($properties, $results); |
|
100 | + $fkObjects=$this->findForeignObjects($fields, $indexValues); |
|
101 | + $this->populateResult($results, $properties, $fkObjects, $fields); |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | /** |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | */ |
108 | 108 | public function getRelationForeignKeys() |
109 | 109 | { |
110 | - $fkObject = $this->getContext()->getForeignRecordFinder(); |
|
110 | + $fkObject=$this->getContext()->getForeignRecordFinder(); |
|
111 | 111 | return $this->findForeignKeys($fkObject, $this->getSourceRecord()); |
112 | 112 | } |
113 | 113 | |
@@ -118,8 +118,8 @@ discard block |
||
118 | 118 | */ |
119 | 119 | protected function setObjectProperty($source, $properties, &$collections) |
120 | 120 | { |
121 | - $hash = $this->getObjectHash($source, $properties); |
|
122 | - $prop = $this->getContext()->getProperty(); |
|
121 | + $hash=$this->getObjectHash($source, $properties); |
|
122 | + $prop=$this->getContext()->getProperty(); |
|
123 | 123 | if(isset($collections[$hash]) && count($collections[$hash]) > 0) |
124 | 124 | { |
125 | 125 | if(count($collections[$hash]) > 1) |
@@ -134,9 +134,9 @@ discard block |
||
134 | 134 | */ |
135 | 135 | public function updateAssociatedRecords() |
136 | 136 | { |
137 | - $fkObject = $this->getContext()->getPropertyValue(); |
|
138 | - $source = $this->getSourceRecord(); |
|
139 | - $fkeys = $this->findForeignKeys($fkObject, $source); |
|
137 | + $fkObject=$this->getContext()->getPropertyValue(); |
|
138 | + $source=$this->getSourceRecord(); |
|
139 | + $fkeys=$this->findForeignKeys($fkObject, $source); |
|
140 | 140 | foreach($fkeys as $fKey => $srcKey) |
141 | 141 | $fkObject->setColumnValue($fKey, $source->getColumnValue($srcKey)); |
142 | 142 | return $fkObject->save(); |
@@ -90,7 +90,7 @@ |
||
90 | 90 | * Handle the "edit" and "new" commands by displaying the edit view. |
91 | 91 | * Default command shows the list view. |
92 | 92 | */ |
93 | - public function bubbleEvent($sender,$param) |
|
93 | + public function bubbleEvent($sender, $param) |
|
94 | 94 | { |
95 | 95 | switch(strtolower($param->getCommandName())) |
96 | 96 | { |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | case 'char': case 'varchar': |
30 | 30 | return $this->createMultiLineControl($container, $column, $record); |
31 | 31 | default: |
32 | - return $this->createDefaultControl($container,$column, $record); |
|
32 | + return $this->createDefaultControl($container, $column, $record); |
|
33 | 33 | } |
34 | 34 | } |
35 | 35 | |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | case 'timestamp': |
45 | 45 | return $this->getDateTimeValue($container, $column, $record); |
46 | 46 | default: |
47 | - return $this->getDefaultControlValue($container,$column, $record); |
|
47 | + return $this->getDefaultControlValue($container, $column, $record); |
|
48 | 48 | } |
49 | 49 | } |
50 | 50 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | case 'datetime': case 'smalldatetime': |
27 | 27 | return $this->createDateTimeControl($container, $column, $record); |
28 | 28 | default: |
29 | - $control = $this->createDefaultControl($container,$column, $record); |
|
29 | + $control=$this->createDefaultControl($container, $column, $record); |
|
30 | 30 | if($column->getIsExcluded()) |
31 | 31 | $control->setEnabled(false); |
32 | 32 | return $control; |
@@ -40,9 +40,9 @@ discard block |
||
40 | 40 | case 'boolean': |
41 | 41 | return $container->findControl(self::DEFAULT_ID)->getChecked(); |
42 | 42 | case 'datetime': case 'smalldatetime': |
43 | - return $this->getDateTimeValue($container,$column, $record); |
|
43 | + return $this->getDateTimeValue($container, $column, $record); |
|
44 | 44 | default: |
45 | - $value = $this->getDefaultControlValue($container,$column, $record); |
|
45 | + $value=$this->getDefaultControlValue($container, $column, $record); |
|
46 | 46 | if(trim($value)==='' && $column->getAllowNull()) |
47 | 47 | return null; |
48 | 48 | else |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | case 'timestamp without time zone': |
31 | 31 | return $this->createDateTimeControl($container, $column, $record); |
32 | 32 | default: |
33 | - return $this->createDefaultControl($container,$column, $record); |
|
33 | + return $this->createDefaultControl($container, $column, $record); |
|
34 | 34 | } |
35 | 35 | } |
36 | 36 | |
@@ -45,9 +45,9 @@ discard block |
||
45 | 45 | case 'time without time zone': |
46 | 46 | return $this->getTimeValue($container, $column, $record); |
47 | 47 | case 'timestamp without time zone': |
48 | - return $this->getDateTimeValue($container,$column, $record); |
|
48 | + return $this->getDateTimeValue($container, $column, $record); |
|
49 | 49 | default: |
50 | - return $this->getDefaultControlValue($container,$column, $record); |
|
50 | + return $this->getDefaultControlValue($container, $column, $record); |
|
51 | 51 | } |
52 | 52 | } |
53 | 53 | } |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | { |
14 | 14 | protected function createControl($container, $column, $record) |
15 | 15 | { |
16 | - $dbtype = trim(str_replace(array('unsigned', 'zerofill'),array('','',),strtolower($column->getDbType()))); |
|
16 | + $dbtype=trim(str_replace(array('unsigned', 'zerofill'), array('', '',), strtolower($column->getDbType()))); |
|
17 | 17 | switch($dbtype) |
18 | 18 | { |
19 | 19 | case 'date': |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | protected function getControlValue($container, $column, $record) |
44 | 44 | { |
45 | - $dbtype = trim(str_replace(array('unsigned', 'zerofill'),array('','',),strtolower($column->getDbType()))); |
|
45 | + $dbtype=trim(str_replace(array('unsigned', 'zerofill'), array('', '',), strtolower($column->getDbType()))); |
|
46 | 46 | switch($dbtype) |
47 | 47 | { |
48 | 48 | case 'date': |
@@ -52,15 +52,15 @@ discard block |
||
52 | 52 | case 'time': |
53 | 53 | return $this->getTimeValue($container, $column, $record); |
54 | 54 | case 'datetime': case 'timestamp': |
55 | - return $this->getDateTimeValue($container,$column, $record); |
|
55 | + return $this->getDateTimeValue($container, $column, $record); |
|
56 | 56 | case 'tinyint': |
57 | - return $this->getIntBooleanValue($container,$column, $record); |
|
57 | + return $this->getIntBooleanValue($container, $column, $record); |
|
58 | 58 | case 'set': |
59 | 59 | return $this->getSetValue($container, $column, $record); |
60 | 60 | case 'enum': |
61 | 61 | return $this->getEnumValue($container, $column, $record); |
62 | 62 | default: |
63 | - return $this->getDefaultControlValue($container,$column, $record); |
|
63 | + return $this->getDefaultControlValue($container, $column, $record); |
|
64 | 64 | } |
65 | 65 | } |
66 | 66 | |
@@ -72,12 +72,12 @@ discard block |
||
72 | 72 | parent::createIntegerControl($container, $column, $record); |
73 | 73 | } |
74 | 74 | |
75 | - protected function getIntBooleanValue($container,$column, $record) |
|
75 | + protected function getIntBooleanValue($container, $column, $record) |
|
76 | 76 | { |
77 | 77 | if($column->getColumnSize()==1) |
78 | - return (int)$container->findControl(self::DEFAULT_ID)->getChecked(); |
|
78 | + return (int) $container->findControl(self::DEFAULT_ID)->getChecked(); |
|
79 | 79 | else |
80 | - return $this->getDefaultControlValue($container,$column, $record); |
|
80 | + return $this->getDefaultControlValue($container, $column, $record); |
|
81 | 81 | } |
82 | 82 | } |
83 | 83 |
@@ -45,10 +45,10 @@ discard block |
||
45 | 45 | */ |
46 | 46 | protected function getListView() |
47 | 47 | { |
48 | - if($this->_list===null && ($id = $this->getListViewID()) !== null) |
|
48 | + if($this->_list===null && ($id=$this->getListViewID())!==null) |
|
49 | 49 | { |
50 | - $this->_list = $this->getParent()->findControl($id); |
|
51 | - if($this->_list ===null) |
|
50 | + $this->_list=$this->getParent()->findControl($id); |
|
51 | + if($this->_list===null) |
|
52 | 52 | throw new TConfigurationException('scaffold_unable_to_find_list_view', $id); |
53 | 53 | } |
54 | 54 | return $this->_list; |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | { |
79 | 79 | if(strtolower($param->getCommandName())==='search') |
80 | 80 | { |
81 | - if(($list = $this->getListView()) !== null) |
|
81 | + if(($list=$this->getListView())!==null) |
|
82 | 82 | { |
83 | 83 | $list->setSearchCondition($this->createSearchCondition()); |
84 | 84 | return false; |
@@ -93,10 +93,10 @@ discard block |
||
93 | 93 | */ |
94 | 94 | protected function createSearchCondition() |
95 | 95 | { |
96 | - $table = $this->getTableInfo(); |
|
96 | + $table=$this->getTableInfo(); |
|
97 | 97 | if(strlen($str=$this->getSearchText()->getText()) > 0) |
98 | 98 | { |
99 | - $builder = $table->createCommandBuilder($this->getRecordFinder()->getDbConnection()); |
|
99 | + $builder=$table->createCommandBuilder($this->getRecordFinder()->getDbConnection()); |
|
100 | 100 | return $builder->getSearchExpression($this->getFields(), $str); |
101 | 101 | } |
102 | 102 | } |
@@ -106,10 +106,10 @@ discard block |
||
106 | 106 | */ |
107 | 107 | protected function getFields() |
108 | 108 | { |
109 | - if(strlen(trim($str=$this->getSearchableFields()))>0) |
|
110 | - $fields = preg_split('/\s*,\s*/', $str); |
|
109 | + if(strlen(trim($str=$this->getSearchableFields())) > 0) |
|
110 | + $fields=preg_split('/\s*,\s*/', $str); |
|
111 | 111 | else |
112 | - $fields = $this->getTableInfo()->getColumns()->getKeys(); |
|
112 | + $fields=$this->getTableInfo()->getColumns()->getKeys(); |
|
113 | 113 | return $fields; |
114 | 114 | } |
115 | 115 | |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | */ |
119 | 119 | public function getSearchableFields() |
120 | 120 | { |
121 | - return $this->getViewState('SearchableFields',''); |
|
121 | + return $this->getViewState('SearchableFields', ''); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | /** |
@@ -70,25 +70,25 @@ discard block |
||
70 | 70 | */ |
71 | 71 | class TActiveRecordConfig extends TDataSourceConfig |
72 | 72 | { |
73 | - const DEFAULT_MANAGER_CLASS = 'System.Data.ActiveRecord.TActiveRecordManager'; |
|
74 | - const DEFAULT_GATEWAY_CLASS = 'System.Data.ActiveRecord.TActiveRecordGateway'; |
|
73 | + const DEFAULT_MANAGER_CLASS='System.Data.ActiveRecord.TActiveRecordManager'; |
|
74 | + const DEFAULT_GATEWAY_CLASS='System.Data.ActiveRecord.TActiveRecordGateway'; |
|
75 | 75 | |
76 | 76 | /** |
77 | 77 | * Defaults to {@link TActiveRecordConfig::DEFAULT_GATEWAY_CLASS DEFAULT_MANAGER_CLASS} |
78 | 78 | * @var string |
79 | 79 | */ |
80 | - private $_managerClass = self::DEFAULT_MANAGER_CLASS; |
|
80 | + private $_managerClass=self::DEFAULT_MANAGER_CLASS; |
|
81 | 81 | |
82 | 82 | /** |
83 | 83 | * Defaults to {@link TActiveRecordConfig::DEFAULT_GATEWAY_CLASS DEFAULT_GATEWAY_CLASS} |
84 | 84 | * @var string |
85 | 85 | */ |
86 | - private $_gatewayClass = self::DEFAULT_GATEWAY_CLASS; |
|
86 | + private $_gatewayClass=self::DEFAULT_GATEWAY_CLASS; |
|
87 | 87 | |
88 | 88 | /** |
89 | 89 | * @var TActiveRecordManager |
90 | 90 | */ |
91 | - private $_manager = null; |
|
91 | + private $_manager=null; |
|
92 | 92 | |
93 | 93 | private $_enableCache=false; |
94 | 94 | |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | * @var TActiveRecordInvalidFinderResult |
99 | 99 | * @since 3.1.5 |
100 | 100 | */ |
101 | - private $_invalidFinderResult = TActiveRecordInvalidFinderResult::Null; |
|
101 | + private $_invalidFinderResult=TActiveRecordInvalidFinderResult::Null; |
|
102 | 102 | |
103 | 103 | /** |
104 | 104 | * Initialize the active record manager. |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | public function init($xml) |
108 | 108 | { |
109 | 109 | parent::init($xml); |
110 | - $manager = $this -> getManager(); |
|
110 | + $manager=$this -> getManager(); |
|
111 | 111 | if($this->getEnableCache()) |
112 | 112 | $manager->setCache($this->getApplication()->getCache()); |
113 | 113 | $manager->setDbConnection($this->getDbConnection()); |
@@ -119,8 +119,8 @@ discard block |
||
119 | 119 | * @return TActiveRecordManager |
120 | 120 | */ |
121 | 121 | public function getManager() { |
122 | - if($this->_manager === null) |
|
123 | - $this->_manager = Prado::createComponent($this -> getManagerClass()); |
|
122 | + if($this->_manager===null) |
|
123 | + $this->_manager=Prado::createComponent($this -> getManagerClass()); |
|
124 | 124 | return TActiveRecordManager::getInstance($this->_manager); |
125 | 125 | } |
126 | 126 | |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | */ |
131 | 131 | public function setManagerClass($value) |
132 | 132 | { |
133 | - $this->_managerClass = TPropertyValue::ensureString($value); |
|
133 | + $this->_managerClass=TPropertyValue::ensureString($value); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | /** |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | */ |
148 | 148 | public function setGatewayClass($value) |
149 | 149 | { |
150 | - $this->_gatewayClass = TPropertyValue::ensureString($value); |
|
150 | + $this->_gatewayClass=TPropertyValue::ensureString($value); |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | /** |
@@ -164,7 +164,7 @@ discard block |
||
164 | 164 | */ |
165 | 165 | public function setEnableCache($value) |
166 | 166 | { |
167 | - $this->_enableCache = TPropertyValue::ensureBoolean($value); |
|
167 | + $this->_enableCache=TPropertyValue::ensureBoolean($value); |
|
168 | 168 | } |
169 | 169 | |
170 | 170 | /** |
@@ -194,6 +194,6 @@ discard block |
||
194 | 194 | */ |
195 | 195 | public function setInvalidFinderResult($value) |
196 | 196 | { |
197 | - $this->_invalidFinderResult = TPropertyValue::ensureEnum($value, 'TActiveRecordInvalidFinderResult'); |
|
197 | + $this->_invalidFinderResult=TPropertyValue::ensureEnum($value, 'TActiveRecordInvalidFinderResult'); |
|
198 | 198 | } |
199 | 199 | } |
@@ -24,7 +24,7 @@ |
||
24 | 24 | protected function getErrorMessageFile() |
25 | 25 | { |
26 | 26 | $lang=Prado::getPreferredLanguage(); |
27 | - $path = dirname(__FILE__); |
|
27 | + $path=dirname(__FILE__); |
|
28 | 28 | $msgFile=$path.'/messages-'.$lang.'.txt'; |
29 | 29 | if(!is_file($msgFile)) |
30 | 30 | $msgFile=$path.'/messages.txt'; |