Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
ApplicationStorage.php
Go to the documentation of this file.
1<?php
2
4
18 private static $datas;
19
25 public static function put(string $key, $value){
26 self::$datas[$key]=$value;
27 }
28
35 public static function get(string $key,$default=null){
36 return self::$datas[$key]??$default;
37 }
38
43 public static function getAllKeys(){
44 return \array_keys(self::$datas);
45 }
46
51 public static function getAll(){
52 return self::$datas;
53 }
54
60 public static function exists(string $key){
61 return isset(self::$datas[$key]);
62 }
63
69 public static function search($value){
70 return \array_search($value,self::$datas);
71 }
72
76 public static function clear(){
77 self::$datas=[];
78 }
79
84 public static function remove(string $key){
85 unset(self::$datas[$key]);
86 }
87}
88
Data storage for async platforms.
static exists(string $key)
Check if a key exists or not.
static clear()
Clear all values in storage.
static search($value)
Search for a given value and returns the first corresponding key if successful.
static getAllKeys()
Return all keys in storage.
static getAll()
Return all datas in storage.
static put(string $key, $value)
Put a value in storage at key position.