MydbRegistry
in package
implements
ArrayAccess, Countable, Traversable, Iterator, Serializable
Singleton or registry helper to manage multiple Mydb instances
Tags
Table of Contents
Interfaces
- ArrayAccess
- Countable
- Traversable
- Iterator
- Serializable
Properties
- $instance : array<string, MydbInterface>
Methods
- __clone() : mixed
- __serialize() : array<string|int, mixed>
- __unserialize() : void
- count() : int
- current() : MydbInterface|null
- Return the current element
- key() : string|null
- Return the key of the current element
- next() : void
- Move forward to next element
- offsetExists() : bool
- Whether an offset exists
- offsetGet() : MydbInterface
- Offset to retrieve
- offsetSet() : void
- Offset to set
- offsetUnset() : void
- Offset to unset
- rewind() : void
- Rewind the Iterator to the first element
- serialize() : string|null
- unserialize() : void
- valid() : bool
- Checks if current position is valid
Properties
$instance
protected
array<string, MydbInterface>
$instance
= []
Methods
__clone()
public
__clone() : mixed
Tags
__serialize()
public
__serialize() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>__unserialize()
public
__unserialize(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
Tags
count()
public
count() : int
Return values
intcurrent()
Return the current element
public
current() : MydbInterface|null
Return values
MydbInterface|nullkey()
Return the key of the current element
public
key() : string|null
Return values
string|nullnext()
Move forward to next element
public
next() : void
offsetExists()
Whether an offset exists
public
offsetExists(string $offset) : bool
Parameters
- $offset : string
Tags
Return values
bool —true on success or false on failure.
offsetGet()
Offset to retrieve
public
offsetGet(string $offset) : MydbInterface
Parameters
- $offset : string
Tags
Return values
MydbInterfaceoffsetSet()
Offset to set
public
offsetSet(string $offset, MydbInterface $value) : void
Parameters
- $offset : string
- $value : MydbInterface
Tags
offsetUnset()
Offset to unset
public
offsetUnset(string $offset) : void
Parameters
- $offset : string
Tags
rewind()
Rewind the Iterator to the first element
public
rewind() : void
serialize()
public
serialize() : string|null
Tags
Return values
string|nullunserialize()
public
unserialize(mixed $data) : void
Parameters
- $data : mixed
Tags
valid()
Checks if current position is valid
public
valid() : bool
Return values
bool —The return value will be boolean and then evaluated. Returns true on success or false on failure.