Completed
Push — work-fleets ( 60e3d3...5fa106 )
by SuperNova.WS
06:18
created
includes/classes/SnCache.php 1 patch
Doc Comments   +24 added lines patch added patch discarded remove patch
@@ -121,6 +121,9 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
   }
Please login to merge, or discard this patch.