@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | private function startVisual() |
31 | 31 | { |
32 | 32 | $scf_generator = new TWsatScaffoldingGenerator(); |
33 | - foreach ($scf_generator->getAllTableNames() as $tableName) |
|
33 | + foreach($scf_generator->getAllTableNames() as $tableName) |
|
34 | 34 | { |
35 | 35 | $dynChb = new TCheckBox(); |
36 | 36 | $dynChb->ID = "cb_$tableName"; |
@@ -48,13 +48,13 @@ discard block |
||
48 | 48 | */ |
49 | 49 | public function generate($sender) |
50 | 50 | { |
51 | - if ($this->IsValid) |
|
51 | + if($this->IsValid) |
|
52 | 52 | { |
53 | 53 | try |
54 | 54 | { |
55 | 55 | $scf_generator = new TWsatScaffoldingGenerator(); |
56 | 56 | $scf_generator->setOpFile($this->output_folder->Text); |
57 | - foreach ($scf_generator->getAllTableNames() as $tableName) |
|
57 | + foreach($scf_generator->getAllTableNames() as $tableName) |
|
58 | 58 | { |
59 | 59 | $id = "cb_$tableName"; |
60 | 60 | $obj = $this->tableNames->findControl($id); |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | array_shift($args); |
56 | 56 | $n = count($args); |
57 | 57 | $tokens = []; |
58 | - for($i = 0;$i < $n;++$i) |
|
58 | + for($i = 0; $i < $n; ++$i) |
|
59 | 59 | $tokens['{' . $i . '}'] = TPropertyValue::ensureString($args[$i]); |
60 | 60 | parent::__construct(strtr($errorMessage, $tokens)); |
61 | 61 | } |
@@ -70,13 +70,13 @@ discard block |
||
70 | 70 | $msgFile = $this->getErrorMessageFile(); |
71 | 71 | |
72 | 72 | // Cache messages |
73 | - if (!isset(self::$_messageCache[$msgFile])) |
|
73 | + if(!isset(self::$_messageCache[$msgFile])) |
|
74 | 74 | { |
75 | 75 | if(($entries = @file($msgFile)) !== false) |
76 | 76 | { |
77 | 77 | foreach($entries as $entry) |
78 | 78 | { |
79 | - list($code, $message) = array_merge(explode('=', $entry, 2), [ '' ]); |
|
79 | + list($code, $message) = array_merge(explode('=', $entry, 2), ['']); |
|
80 | 80 | self::$_messageCache[$msgFile][trim($code)] = trim($message); |
81 | 81 | } |
82 | 82 | } |
@@ -46,8 +46,9 @@ |
||
46 | 46 | array_shift($args); |
47 | 47 | $n = count($args); |
48 | 48 | $tokens = []; |
49 | - for($i = 0;$i < $n;++$i) |
|
50 | - $tokens['{' . $i . '}'] = TPropertyValue::ensureString($args[$i]); |
|
49 | + for($i = 0;$i < $n;++$i) { |
|
50 | + $tokens['{' . $i . '}'] = TPropertyValue::ensureString($args[$i]); |
|
51 | + } |
|
51 | 52 | parent::__construct(strtr($errorMessage, $tokens)); |
52 | 53 | } |
53 | 54 |
@@ -35,8 +35,8 @@ discard block |
||
35 | 35 | */ |
36 | 36 | public function getSearchExpression($fields, $keywords) { |
37 | 37 | $columns = []; |
38 | - foreach ($fields as $field) { |
|
39 | - if ($this->isSearchableColumn($this->getTableInfo()->getColumn($field))) |
|
38 | + foreach($fields as $field) { |
|
39 | + if($this->isSearchableColumn($this->getTableInfo()->getColumn($field))) |
|
40 | 40 | $columns[] = $field; |
41 | 41 | } |
42 | 42 | return parent :: getSearchExpression($columns, $keywords); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | * @return string SQL with limit and offset in Oracle way. |
78 | 78 | */ |
79 | 79 | public function applyLimitOffset($sql, $limit = -1, $offset = -1) { |
80 | - if ((int) $limit <= 0 && (int) $offset <= 0) |
|
80 | + if((int) $limit <= 0 && (int) $offset <= 0) |
|
81 | 81 | return $sql; |
82 | 82 | |
83 | 83 | $pradoNUMLIN = 'pradoNUMLIN'; |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $WhereInSubSelect = "WHERE " . substr($sql, strpos($sql, 'WHERE') + 5, $nfimDoWhere - $niniDoWhere); |
94 | 94 | |
95 | 95 | $sORDERBY = ''; |
96 | - if (stripos($sql, 'ORDER') !== false) { |
|
96 | + if(stripos($sql, 'ORDER') !== false) { |
|
97 | 97 | $p = stripos($sql, 'ORDER'); |
98 | 98 | $sORDERBY = substr($sql, $p + 8); |
99 | 99 | } |
@@ -102,23 +102,23 @@ discard block |
||
102 | 102 | $fields = trim(substr($fields, $niniDoSelect)); |
103 | 103 | $aliasedFields = ', '; |
104 | 104 | |
105 | - if (trim($fields) == '*') { |
|
105 | + if(trim($fields) == '*') { |
|
106 | 106 | $aliasedFields = ", {$fieldsALIAS}.{$fields}"; |
107 | 107 | $fields = ''; |
108 | 108 | $arr = $this->getTableInfo()->getColumns(); |
109 | - foreach ($arr as $field) { |
|
109 | + foreach($arr as $field) { |
|
110 | 110 | $fields .= strtolower($field->getColumnName()) . ', '; |
111 | 111 | } |
112 | 112 | $fields = str_replace('"', '', $fields); |
113 | 113 | $fields = trim($fields); |
114 | 114 | $fields = substr($fields, 0, strlen($fields) - 1); |
115 | 115 | } else { |
116 | - if (strpos($fields, ',') !== false) { |
|
116 | + if(strpos($fields, ',') !== false) { |
|
117 | 117 | $arr = $this->getTableInfo()->getColumns(); |
118 | - foreach ($arr as $field) { |
|
118 | + foreach($arr as $field) { |
|
119 | 119 | $field = strtolower($field); |
120 | 120 | $existAS = str_ireplace(' as ', '-as-', $field); |
121 | - if (strpos($existAS, '-as-') === false) |
|
121 | + if(strpos($existAS, '-as-') === false) |
|
122 | 122 | $aliasedFields .= "{$fieldsALIAS}." . trim($field) . ", "; |
123 | 123 | else |
124 | 124 | $aliasedFields .= "{$field}, "; |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | $aliasedFields = substr($aliasedFields, 0, strlen($aliasedFields) - 1); |
128 | 128 | } |
129 | 129 | } |
130 | - if ($aliasedFields == ', ') |
|
130 | + if($aliasedFields == ', ') |
|
131 | 131 | $aliasedFields = " , $fieldsALIAS.* "; |
132 | 132 | |
133 | 133 | /* ************************ |
@@ -138,10 +138,10 @@ discard block |
||
138 | 138 | ") WHERE {$pradoNUMLIN} >= {$offset} "; |
139 | 139 | |
140 | 140 | ************************* */ |
141 | - $offset = (int)$offset; |
|
142 | - $toReg = $offset + $limit ; |
|
141 | + $offset = (int) $offset; |
|
142 | + $toReg = $offset + $limit; |
|
143 | 143 | $fullTableName = $this->getTableInfo()->getTableFullName(); |
144 | - if (empty($sORDERBY)) |
|
144 | + if(empty($sORDERBY)) |
|
145 | 145 | $sORDERBY = "ROWNUM"; |
146 | 146 | |
147 | 147 | $newSql = " SELECT $fields FROM " . |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | $cache = $this->getCache(); |
45 | 45 | $keyname = $this->getBaseKeyKeyName(); |
46 | 46 | $basekey = $cache->get($keyname); |
47 | - if (!$basekey) |
|
47 | + if(!$basekey) |
|
48 | 48 | { |
49 | 49 | $basekey = DxUtil::generateRandomHash(8); |
50 | 50 | $cache->set($keyname, $basekey); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | protected function getCache() |
82 | 82 | { |
83 | - if (!$this->_cache) |
|
83 | + if(!$this->_cache) |
|
84 | 84 | $this->_cache = Prado::getApplication()->getCache(); |
85 | 85 | return $this->_cache; |
86 | 86 | } |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | protected function getKeyListId() |
45 | 45 | { |
46 | 46 | $id = 'keyList'; |
47 | - if ($this->_cacheModel instanceof TSqlMapCacheModel) |
|
47 | + if($this->_cacheModel instanceof TSqlMapCacheModel) |
|
48 | 48 | $id .= '_' . $this->_cacheModel->getId(); |
49 | 49 | return $id; |
50 | 50 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | */ |
55 | 55 | protected function getKeyList() |
56 | 56 | { |
57 | - if (($keyList = $this->getCache()->get($this->getKeyListId())) === false) |
|
57 | + if(($keyList = $this->getCache()->get($this->getKeyListId())) === false) |
|
58 | 58 | { |
59 | 59 | $keyList = new TList(); |
60 | 60 | $this->getCache()->set($this->getKeyListId(), $keyList); |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | { |
86 | 86 | $keyList = $this->getKeyList(); |
87 | 87 | $cache = $this->getCache(); |
88 | - foreach ($keyList as $key) |
|
88 | + foreach($keyList as $key) |
|
89 | 89 | { |
90 | 90 | $cache->delete($key); |
91 | 91 | } |
@@ -99,11 +99,11 @@ discard block |
||
99 | 99 | public function get($key) |
100 | 100 | { |
101 | 101 | $result = $this->getCache()->get($key); |
102 | - if ($result === false) |
|
102 | + if($result === false) |
|
103 | 103 | { |
104 | 104 | // if the key has not been found in cache (e.g expired), remove from keylist |
105 | 105 | $keyList = $this->getKeyList(); |
106 | - if ($keyList->contains($key)) |
|
106 | + if($keyList->contains($key)) |
|
107 | 107 | { |
108 | 108 | $keyList->remove($key); |
109 | 109 | $this->setKeyList($keyList); |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | { |
122 | 122 | $this->getCache()->set($key, $value, $expire, $dependency); |
123 | 123 | $keyList = $this->getKeyList(); |
124 | - if (!$keyList->contains($key)) |
|
124 | + if(!$keyList->contains($key)) |
|
125 | 125 | { |
126 | 126 | $keyList->add($key); |
127 | 127 | $this->setKeyList($keyList); |
@@ -29,6 +29,6 @@ |
||
29 | 29 | */ |
30 | 30 | class TActiveRecordInvalidFinderResult extends \Prado\TEnumerable |
31 | 31 | { |
32 | - const Null = 'Null'; |
|
32 | + const null = 'Null'; |
|
33 | 33 | const Exception = 'Exception'; |
34 | 34 | } |
35 | 35 | \ No newline at end of file |
@@ -70,7 +70,7 @@ |
||
70 | 70 | $fname = ucwords(str_replace('_', ' ', $name)); |
71 | 71 | $sorts[$name . ' ASC'] = $fname . ' Ascending'; |
72 | 72 | $sorts[$name . ' DESC'] = $fname . ' Descending'; |
73 | - $headers[] = $fname ; |
|
73 | + $headers[] = $fname; |
|
74 | 74 | } |
75 | 75 | $this->_sort->setDataSource($sorts); |
76 | 76 | $this->_sort->dataBind(); |
@@ -102,7 +102,7 @@ |
||
102 | 102 | * @var TActiveRecordInvalidFinderResult |
103 | 103 | * @since 3.1.5 |
104 | 104 | */ |
105 | - private $_invalidFinderResult = TActiveRecordInvalidFinderResult::Null; |
|
105 | + private $_invalidFinderResult = TActiveRecordInvalidFinderResult::null; |
|
106 | 106 | |
107 | 107 | /** |
108 | 108 | * Initialize the active record manager. |
@@ -100,7 +100,7 @@ |
||
100 | 100 | */ |
101 | 101 | public function _read($id) |
102 | 102 | { |
103 | - return (string)$this->_cache->get($this->calculateKey($id)); |
|
103 | + return (string) $this->_cache->get($this->calculateKey($id)); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | /** |