\PhileRegistry

the Registry class for implementing a registry

Summary

Methods
Properties
Constants
getInstance()
setInstance()
get()
set()
isRegistered()
__construct()
offsetExists()
No public properties found
No constants found
init()
No protected properties found
N/A
No private methods found
$registry
N/A

Properties

$registry

$registry :\Phile\Core\Registry

Registry object provides storage for shared objects.

Type

\Phile\Core\Registry

Methods

getInstance()

getInstance(): \Phile\Core\Registry

Retrieves the default registry instance.

Returns

\Phile\Core\Registry

setInstance()

setInstance(\Phile\Core\Registry  $registry)

Set the default registry instance to a specified instance.

Parameters

\Phile\Core\Registry $registry

An object instance of type Registry, or a subclass.

Throws

\Exception

get()

get(string  $index): mixed

getter method, basically same as offsetGet().

This method can be called from an object of type Registry, or it can be called statically. In the latter case, it uses the default static instance stored in the class.

Parameters

string $index
  • get the value associated with $index

Throws

\Exception

if no entry is registerd for $index.

Returns

mixed

set()

set(string  $index,mixed  $value): void

setter method, basically same as offsetSet().

This method can be called from an object of type Registry, or it can be called statically. In the latter case, it uses the default static instance stored in the class.

Parameters

string $index

The location in the ArrayObject in which to store the value.

mixed $value

The object to store in the ArrayObject.

isRegistered()

isRegistered(string  $index): boolean

Returns TRUE if the $index is a named value in the registry, or FALSE if $index was not found in the registry.

Parameters

string $index

Returns

boolean

__construct()

__construct(array  $array = array(),integer  $flags = parent::ARRAY_AS_PROPS)

the constructor

Parameters

array $array

data array

integer $flags

ArrayObject flags

offsetExists()

offsetExists(string  $index)

method to check if offset exists

Parameters

string $index

init()

init(): void

Initialize the default registry instance.