ILIAS  trunk Revision v11.0_alpha-1831-g8615d53dadb
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
GuzzleHttp\Client\ItemState Class Reference

Class ItemState. More...

+ Collaboration diagram for GuzzleHttp\Client\ItemState:

Public Member Functions

 __construct (private IdentificationInterface $identification)
 ItemState constructor. More...
 
 isItemActive ()
 
 getStorage ()
 

Data Fields

const LEVEL_OF_TOOL = 1
 
const COOKIE_NS_GS = 'gs_active_items'
 

Protected Attributes

WrapperFactory $wrapper
 
Factory $refinery
 

Private Attributes

array $storage
 

Detailed Description

Class ItemState.

Author
Fabian Schmid fs@st.nosp@m.uder.nosp@m.-raim.nosp@m.ann..nosp@m.ch

Definition at line 33 of file ItemState.php.

Constructor & Destructor Documentation

◆ __construct()

GuzzleHttp\Client\ItemState::__construct ( private IdentificationInterface  $identification)

ItemState constructor.

Parameters
IdentificationInterface$identification

Definition at line 49 of file ItemState.php.

References $DIC, GuzzleHttp\Client\ItemState\getStorage(), ilInitialisation\initILIAS(), and ILIAS\Repository\refinery().

50  {
51  $this->storage = $this->getStorage();
53  global $DIC;
54  $this->wrapper = $DIC->http()->wrapper();
55  $this->refinery = $DIC->refinery();
56  }
static initILIAS()
ilias initialisation
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

Member Function Documentation

◆ getStorage()

GuzzleHttp\Client\ItemState::getStorage ( )
Returns
mixed[]

Definition at line 69 of file ItemState.php.

References ILIAS\Repository\refinery().

Referenced by GuzzleHttp\Client\ItemState\__construct().

69  : array
70  {
71  static $json_decode;
72  if (!isset($json_decode)) {
73  $cookie_value = $this->wrapper->cookie()->has(self::COOKIE_NS_GS)
74  ? $this->wrapper->cookie()->retrieve(self::COOKIE_NS_GS, $this->refinery->to()->string())
75  : '{}';
76 
77  $json_decode = json_decode((string) $cookie_value, true);
78  $json_decode = is_array($json_decode) ? $json_decode : [];
79  }
80 
81  return $json_decode;
82  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isItemActive()

GuzzleHttp\Client\ItemState::isItemActive ( )

Definition at line 58 of file ItemState.php.

References Vendor\Package\$b.

58  : bool
59  {
60  $hash = $this->hash($this->identification->serialize());
61  $b = isset($this->storage[$hash]) && $this->storage[$hash] == true;
62 
63  return $b;
64  }

Field Documentation

◆ $refinery

Factory GuzzleHttp\Client\ItemState::$refinery
protected

Definition at line 42 of file ItemState.php.

◆ $storage

array GuzzleHttp\Client\ItemState::$storage
private

Definition at line 39 of file ItemState.php.

◆ $wrapper

WrapperFactory GuzzleHttp\Client\ItemState::$wrapper
protected

Definition at line 41 of file ItemState.php.

◆ COOKIE_NS_GS

const GuzzleHttp\Client\ItemState::COOKIE_NS_GS = 'gs_active_items'

Definition at line 38 of file ItemState.php.

◆ LEVEL_OF_TOOL

const GuzzleHttp\Client\ItemState::LEVEL_OF_TOOL = 1

Definition at line 37 of file ItemState.php.

Referenced by GuzzleHttp\Client\ModeToggle\saveStateOfAll().


The documentation for this class was generated from the following file: