PHP Class Jyxo\Spl\ObjectCache

Example: $key = 'User_Friends/' . $user->username(); return \Jyxo\Spl\ObjectCache::get($key) ?: \Jyxo\Spl\ObjectCache::set($key, new \User\Friends($this->context, $user));
Author: Jakub Tománek
Inheritance: implements IteratorAggregate
Afficher le fichier Open project: jyxo/php Class Usage Examples

Méthodes publiques

Méthode Description
__get ( string $key ) : object Returns an object from an own storage.
__isset ( string $key ) : boolean Returns if there's an object with key $key in the storage.
__set ( string $key, object $value ) Saves an object into an own storage.
__unset ( mixed $key ) Deletes an object with key $key from the storage.
clear ( ) : self Clear the whole storage.
get ( string $key ) : object Returns an object from the default storage.
getInstance ( ) : self Returns default storage for static access.
getIterator ( ) : ArrayIterator Returns an iterator.
set ( string $key, object $value ) : object Saves an object into the default storage.

Method Details

__get() public méthode

Returns an object from an own storage.
public __get ( string $key ) : object
$key string Object key
Résultat object

__isset() public méthode

Returns if there's an object with key $key in the storage.
public __isset ( string $key ) : boolean
$key string Object key
Résultat boolean

__set() public méthode

Saves an object into an own storage.
public __set ( string $key, object $value )
$key string Object key
$value object Object

__unset() public méthode

Deletes an object with key $key from the storage.
public __unset ( mixed $key )
$key mixed Object key

clear() public méthode

Clear the whole storage.
public clear ( ) : self
Résultat self

get() public static méthode

Returns an object from the default storage.
public static get ( string $key ) : object
$key string Object key
Résultat object

getInstance() public static méthode

Returns default storage for static access.
public static getInstance ( ) : self
Résultat self

getIterator() public méthode

Returns an iterator.
public getIterator ( ) : ArrayIterator
Résultat ArrayIterator

set() public static méthode

Saves an object into the default storage.
public static set ( string $key, object $value ) : object
$key string Object key
$value object Object
Résultat object saved object