@@ -119,10 +119,17 @@ |
||
119 | 119 | return $this; |
120 | 120 | } |
121 | 121 | |
122 | + /** |
|
123 | + * @param string $functionName |
|
124 | + * @param string $alias |
|
125 | + */ |
|
122 | 126 | public function fieldSingleFunction($functionName, $field = '*', $alias = DbSqlLiteral::SQL_LITERAL_ALIAS_NONE) { |
123 | 127 | return $this->field(DbSqlLiteral::build($this->db)->buildSingleArgument($functionName, $field, $alias)); |
124 | 128 | } |
125 | 129 | |
130 | + /** |
|
131 | + * @param string $alias |
|
132 | + */ |
|
126 | 133 | public function fieldCount($field = '*', $alias = DbSqlLiteral::SQL_LITERAL_ALIAS_NONE) { |
127 | 134 | return $this->field(DbSqlLiteral::build($this->db)->count($field, $alias)); |
128 | 135 | } |
@@ -118,7 +118,7 @@ |
||
118 | 118 | * @param mixed $offset <p> |
119 | 119 | * The offset to assign the value to. |
120 | 120 | * </p> |
121 | - * @param mixed $value <p> |
|
121 | + * @param Unit $value <p> |
|
122 | 122 | * The value to set. |
123 | 123 | * </p> |
124 | 124 | * |
@@ -76,6 +76,9 @@ discard block |
||
76 | 76 | } |
77 | 77 | } |
78 | 78 | |
79 | + /** |
|
80 | + * @param string $name |
|
81 | + */ |
|
79 | 82 | private function getPhysicalPropertyName($name) { |
80 | 83 | return '_' . $name; |
81 | 84 | } |
@@ -146,6 +149,9 @@ discard block |
||
146 | 149 | return $this->propertyMethodResult($name, $diff, 'delta'); |
147 | 150 | } |
148 | 151 | |
152 | + /** |
|
153 | + * @param string $action |
|
154 | + */ |
|
149 | 155 | protected function actionProperty($action, $name, $value) { |
150 | 156 | $result = null; |
151 | 157 | // Now deciding - will we call a protected setter or will we work with protected property |
@@ -121,6 +121,9 @@ discard block |
||
121 | 121 | } |
122 | 122 | } |
123 | 123 | |
124 | + /** |
|
125 | + * @param string $filter |
|
126 | + */ |
|
124 | 127 | public static function queryCacheSetByFilter($location_type, $filter, $record_id) { |
125 | 128 | SnCache::$queries[$location_type][$filter][$record_id] = &SnCache::getDataRefByLocationAndId($location_type, $record_id); |
126 | 129 | } |
@@ -160,14 +163,23 @@ discard block |
||
160 | 163 | return true; // Не всегда - от результата |
161 | 164 | } |
162 | 165 | |
166 | + /** |
|
167 | + * @param integer $locationType |
|
168 | + */ |
|
163 | 169 | public static function getData($locationType = LOC_NONE) { |
164 | 170 | return $locationType == LOC_NONE ? static::$data : static::$data[$locationType]; |
165 | 171 | } |
166 | 172 | |
173 | + /** |
|
174 | + * @param integer $locationType |
|
175 | + */ |
|
167 | 176 | public static function cacheUnsetElement($locationType, $recordId) { |
168 | 177 | static::$data[$locationType][$recordId] = null; |
169 | 178 | } |
170 | 179 | |
180 | + /** |
|
181 | + * @param integer $locationType |
|
182 | + */ |
|
171 | 183 | public static function isArrayLocation($locationType) { |
172 | 184 | return is_array(static::$data[$locationType]); |
173 | 185 | } |
@@ -190,6 +202,9 @@ discard block |
||
190 | 202 | } |
191 | 203 | } |
192 | 204 | |
205 | + /** |
|
206 | + * @param integer $unit_snid |
|
207 | + */ |
|
193 | 208 | public static function getUnitLocator($location_type, $location_id, $unit_snid) { |
194 | 209 | return $unit_snid ? static::$locator[LOC_UNIT][$location_type][$location_id][$unit_snid] : static::$locator[LOC_UNIT][$location_type][$location_id]; |
195 | 210 | } |
@@ -222,14 +237,23 @@ discard block |
||
222 | 237 | return static::$locks; |
223 | 238 | } |
224 | 239 | |
240 | + /** |
|
241 | + * @param string $filter |
|
242 | + */ |
|
225 | 243 | public static function getQueriesByLocationAndFilter($locationType, $filter) { |
226 | 244 | return !empty(static::$queries[$locationType][$filter]) && is_array(static::$queries[$locationType][$filter]) ? static::$queries[$locationType][$filter] : array(); |
227 | 245 | } |
228 | 246 | |
247 | + /** |
|
248 | + * @param string $filter |
|
249 | + */ |
|
229 | 250 | public static function isQueryCacheByLocationAndFilterEmpty($locationType, $filter) { |
230 | 251 | return !isset(SnCache::$queries[$locationType][$filter]) || SnCache::$queries[$locationType][$filter] === null; |
231 | 252 | } |
232 | 253 | |
254 | + /** |
|
255 | + * @param string $filter |
|
256 | + */ |
|
233 | 257 | public static function queryCacheResetByLocationAndFilter($locationType, $filter) { |
234 | 258 | SnCache::$queries[$locationType][$filter] = array(); |
235 | 259 | } |
@@ -81,6 +81,10 @@ discard block |
||
81 | 81 | // ------------------------------------------------------------------------- |
82 | 82 | // Here comes low-level functions - those that directly works with cacher engines |
83 | 83 | // ------------------------------------------------------------------------- |
84 | + |
|
85 | + /** |
|
86 | + * @param string $name |
|
87 | + */ |
|
84 | 88 | public function __set($name, $value) { |
85 | 89 | switch ($name) { |
86 | 90 | case '_MODE': |
@@ -132,6 +136,9 @@ discard block |
||
132 | 136 | return null; |
133 | 137 | } |
134 | 138 | |
139 | + /** |
|
140 | + * @param string $name |
|
141 | + */ |
|
135 | 142 | public function __isset($name) { |
136 | 143 | switch (self::$mode) { |
137 | 144 | case CACHER_NO_CACHE: |
@@ -173,6 +173,9 @@ |
||
173 | 173 | } |
174 | 174 | |
175 | 175 | |
176 | + /** |
|
177 | + * @param string $path |
|
178 | + */ |
|
176 | 179 | protected function lng_try_filepath($path, $file_path_relative) { |
177 | 180 | $file_path = SN_ROOT_PHYSICAL . ($path && file_exists(SN_ROOT_PHYSICAL . $path . $file_path_relative) ? $path : '') . $file_path_relative; |
178 | 181 | return file_exists($file_path) ? $file_path : false; |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | * <p>null - транзакция НЕ должна быть запущена</p> |
324 | 324 | * <p>true - транзакция должна быть запущена - для совместимости с $for_update</p> |
325 | 325 | * <p>false - всё равно - для совместимости с $for_update</p> |
326 | - * @return bool Текущий статус транзакции |
|
326 | + * @return null|boolean Текущий статус транзакции |
|
327 | 327 | */ |
328 | 328 | public static function db_transaction_check($status = null) { |
329 | 329 | $error_msg = false; |
@@ -399,7 +399,7 @@ discard block |
||
399 | 399 | /** |
400 | 400 | * Блокирует указанные таблицу/список таблиц |
401 | 401 | * |
402 | - * @param string|array $tables Таблица/список таблиц для блокировки. Названия таблиц - без префиксов |
|
402 | + * @param string $tables Таблица/список таблиц для блокировки. Названия таблиц - без префиксов |
|
403 | 403 | * <p>string - название таблицы для блокировки</p> |
404 | 404 | * <p>array - массив, где ключ - имя таблицы, а значение - условия блокировки элементов</p> |
405 | 405 | */ |
@@ -574,6 +574,9 @@ discard block |
||
574 | 574 | return $result; |
575 | 575 | } |
576 | 576 | |
577 | + /** |
|
578 | + * @param integer $location_type |
|
579 | + */ |
|
577 | 580 | public static function db_ins_field_set($location_type, $field_set, $serialize = false) { |
578 | 581 | // TODO multiinsert |
579 | 582 | !sn_db_field_set_is_safe($field_set) ? $field_set = sn_db_field_set_make_safe($field_set, $serialize) : false; |
@@ -70,6 +70,9 @@ discard block |
||
70 | 70 | $this->numqueries = 0; |
71 | 71 | } |
72 | 72 | |
73 | + /** |
|
74 | + * @param string $mes |
|
75 | + */ |
|
73 | 76 | function add($mes) { |
74 | 77 | $this->log .= $mes; |
75 | 78 | $this->numqueries++; |
@@ -185,6 +188,9 @@ discard block |
||
185 | 188 | return $error_backtrace; |
186 | 189 | } |
187 | 190 | |
191 | + /** |
|
192 | + * @param string $die_message |
|
193 | + */ |
|
188 | 194 | function error_fatal($die_message, $details = 'There is a fatal error on page') { |
189 | 195 | // TODO - Записывать детали ошибки в лог-файл |
190 | 196 | die($die_message); |
@@ -239,6 +239,9 @@ |
||
239 | 239 | } |
240 | 240 | } |
241 | 241 | |
242 | + /** |
|
243 | + * @param string $arrayName |
|
244 | + */ |
|
242 | 245 | protected function mergeArraySpecial($arrayName) { |
243 | 246 | global $sn_mvc; |
244 | 247 |