Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
fusercache.php
1<?php
2
4
5
8
9final class FuserCache
10{
12 private $fuserIds = array();
14 private static $instance;
15
16 private function __construct()
17 {}
18
19 private function __clone()
20 {}
21
26 public static function getInstance()
27 {
28 if (!isset(self::$instance))
29 {
30 self::$instance = new static;
31 }
32
33 return self::$instance;
34 }
35
41 public function getUserIdById($fuserId)
42 {
43 if(!isset($this->fuserIds[$fuserId]))
44 {
45 $this->fuserIds[$fuserId] = \Bitrix\Sale\Fuser::getUserIdById($fuserId);
46 }
47
48 return $this->fuserIds[$fuserId];
49 }
50
55 public function clean()
56 {
57 $this->fuserIds = array();
58 }
59}