\Aura\IntlPackageLocator

A ServiceLocator implementation for loading and retaining translator objects.

Summary

Methods
Properties
Constants
__construct()
set()
get()
No public properties found
No constants found
No protected methods found
$registry
$converted
N/A
No private methods found
No private properties found
N/A

Properties

$registry

$registry : array

A registry of packages.

Unlike many other registries, this one is two layers deep. The first key is a package name, the second key is a locale code, and the value is a callable that returns a Package object for that name and locale.

Type

array

$converted

$converted : array

Tracks whether or not a registry entry has been converted from a callable to a Package object.

Type

array

Methods

__construct()

__construct(array  $registry = array()) 

Constructor.

Parameters

array $registry

A registry of packages.

set()

set(string  $name, string  $locale, callable  $spec) : void

Sets a Package object.

Parameters

string $name

The package name.

string $locale

The locale for the package.

callable $spec

A callable that returns a package.

get()

get(string  $name, string  $locale) : \Aura\Intl\Package

Gets a Package object.

Parameters

string $name

The package name.

string $locale

The locale for the package.

Returns

\Aura\Intl\Package