Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
CacheTrait.php
1
<?php
2
3
namespace
Bitrix\Socialnetwork\Space\Toolbar\Switcher
;
4
5
trait
CacheTrait
6
{
7
private
static
?
SwitcherCollection
$switchers =
null
;
8
9
public
static
function
get
(
int
$userId, ?
int
$spaceId,
string
$code):
SwitcherInterface
10
{
11
static::init();
12
14
$switcher =
new
static
($userId, $spaceId, $code);
15
if
(static::$switchers->has($switcher))
16
{
17
return
$switcher;
18
}
19
20
static::$switchers->add($switcher);
21
return
$switcher;
22
}
23
24
private
static
function
init():
void
25
{
26
if
(is_null(static::$switchers))
27
{
28
static::$switchers =
new
SwitcherCollection
();
29
}
30
}
31
32
public
function
invalidate
(): void
33
{
34
$this->isInitialized =
false
;
35
}
36
}
Bitrix\Socialnetwork\Space\Toolbar\Switcher\SwitcherCollection
Definition
SwitcherCollection.php:9
Bitrix\Socialnetwork\Space\Toolbar\Switcher\SwitcherInterface
Definition
SwitcherInterface.php:8
Bitrix\Socialnetwork\Space\Toolbar\Switcher
Definition
AbstractSwitcher.php:3
Bitrix\Socialnetwork\Space\Toolbar\Switcher\CacheTrait
trait CacheTrait
Definition
CacheTrait.php:6
Bitrix\Socialnetwork\Space\Toolbar\Switcher\invalidate
invalidate()
Definition
CacheTrait.php:32
modules
socialnetwork
lib
Space
Toolbar
Switcher
CacheTrait.php
Создано системой
1.10.0