Overview

Namespaces

  • Jyxo
    • Beholder
      • TestCase
    • Gettext
      • Parser
    • Input
      • Chain
      • Filter
      • Validator
    • Mail
      • Email
        • Attachment
      • Parser
      • Sender
    • Rpc
      • Json
      • Xml
    • Shell
    • Spl
    • Svn
    • Time
    • Webdav
  • PHP

Classes

  • ArrayUtil
  • CountableLimitIterator
  • FilterIterator
  • MapIterator
  • Object
  • ObjectCache

Interfaces

  • ArrayCopy
  • Overview
  • Namespace
  • Class
  • Tree
  • Deprecated

Class ObjectCache

Simple object cache so we don't have to create them or write caching over again.

Example:

$key = 'User_Friends/' . $user->username();
return \Jyxo\Spl\ObjectCache::get($key) ?: \Jyxo\Spl\ObjectCache::set($key, new \User\Friends($this->context, $user));
Jyxo\Spl\ObjectCache implements IteratorAggregate
Namespace: Jyxo\Spl
Category: Jyxo
Package: Jyxo\Spl
Copyright: Copyright (c) 2005-2011 Jyxo, s.r.o.
License: https://github.com/jyxo/php/blob/master/license.txt
Author: Jakub Tománek
Located at Spl/ObjectCache.php
Methods summary
public static Jyxo\Spl\ObjectCache
# getInstance( )

Returns default storage for static access.

Returns default storage for static access.

Returns

Jyxo\Spl\ObjectCache
public static object
# get( string $key )

Returns an object from the default storage.

Returns an object from the default storage.

Parameters

$key
string
Object key

Returns

object
public Jyxo\Spl\ObjectCache
# clear( )

Clear the whole storage.

Clear the whole storage.

Returns

Jyxo\Spl\ObjectCache
public static object
# set( string $key, object $value )

Saves an object into the default storage.

Saves an object into the default storage.

Parameters

$key
string
Object key
$value
object
Object

Returns

object
saved object
public object
# __get( string $key )

Returns an object from an own storage.

Returns an object from an own storage.

Parameters

$key
string
Object key

Returns

object
public
# __set( string $key, object $value )

Saves an object into an own storage.

Saves an object into an own storage.

Parameters

$key
string
Object key
$value
object
Object
public boolean
# __isset( string $key )

Returns if there's an object with key $key in the storage.

Returns if there's an object with key $key in the storage.

Parameters

$key
string
Object key

Returns

boolean
public
# __unset( mixed $key )

Deletes an object with key $key from the storage.

Deletes an object with key $key from the storage.

Parameters

$key
mixed
Object key
public ArrayIterator
# getIterator( )

Returns an iterator.

Returns an iterator.

Returns

ArrayIterator

Implementation of

IteratorAggregate::getIterator
Jyxo PHP Library API documentation generated by ApiGen 2.3.0