Fr3nch13/CakePHP Utilities

LocatorInterface extends LocatorInterface

Registries for Table objects should implement this interface.

Table of Contents

Methods

clear()  : void
Clears the registry of configuration and instances.
exists()  : bool
Check to see if an instance exists in the registry.
get()  : Table
Get a table instance from the registry.
getConfig()  : array<string|int, mixed>
Returns configuration for an alias or the full configuration array for all aliases.
remove()  : void
Removes an repository instance from the registry.
set()  : Table
Set a table instance.
setConfig()  : $this
Stores a list of options to be used when instantiating an object with a matching alias.

Methods

clear()

Clears the registry of configuration and instances.

public clear() : void

exists()

Check to see if an instance exists in the registry.

public exists(string $alias) : bool
Parameters
$alias : string

The alias to check for.

Return values
bool

get()

Get a table instance from the registry.

public get(string $alias[, array<string, mixed> $options = [] ]) : Table
Parameters
$alias : string

The alias name you want to get.

$options : array<string, mixed> = []

The options you want to build the table with.

Return values
Table

getConfig()

Returns configuration for an alias or the full configuration array for all aliases.

public getConfig([string|null $alias = null ]) : array<string|int, mixed>
Parameters
$alias : string|null = null

Alias to get config for, null for complete config.

Return values
array<string|int, mixed>

The config data.

remove()

Removes an repository instance from the registry.

public remove(string $alias) : void
Parameters
$alias : string

The alias to remove.

set()

Set a table instance.

public set(string $alias, Table $repository) : Table
Parameters
$alias : string

The alias to set.

$repository : Table

The table to set.

Tags
psalm-suppress

MoreSpecificImplementedParamType

Return values
Table

setConfig()

Stores a list of options to be used when instantiating an object with a matching alias.

public setConfig(array<string, mixed>|string $alias[, array<string, mixed>|null $options = null ]) : $this
Parameters
$alias : array<string, mixed>|string

Name of the alias or array to completely overwrite current config.

$options : array<string, mixed>|null = null

list of options for the alias

Tags
throws
RuntimeException

When you attempt to configure an existing table instance.

Return values
$this

        
On this page

Search results