• Full name: \App\Infrastructure\Services\Attribute\AttributeManager
  • This class is marked as final and can't be subclassed
  • This class is a Final class

Properties

type

private string $type

repository

private \App\Infrastructure\Services\Attribute\AttributeRepository $repository

cache

private \Psr\SimpleCache\CacheInterface $cache

Methods

__construct

public __construct(string $type, \App\Infrastructure\Services\Attribute\AttributeRepository $repository, \Psr\SimpleCache\CacheInterface $cache): mixed

Parameters:

Parameter Type Description
$type string
$repository \App\Infrastructure\Services\Attribute\AttributeRepository
$cache \Psr\SimpleCache\CacheInterface

factory

public static factory(string $type, string $namespace = 'attributes'): self
  • This method is static. Parameters:
Parameter Type Description
$type string
$namespace string

Throws:


get

Retrieve attributes for the specified array.

public get(string $id, string $key, mixed $default = null): mixed

Parameters:

Parameter Type Description
$id string ID of the array attribute is for.
$key string Attribute key.
$default mixed Value to return if no result is found.

Return Value:

Value.


all

public all(string $id): string

Parameters:

Parameter Type Description
$id string

bag

public bag(string $id): \App\Infrastructure\Services\Attribute\AttributeBag

Parameters:

Parameter Type Description
$id string

set

public set(string $id, string $key, mixed $value): \App\Infrastructure\Services\Attribute\AttributeBag

Parameters:

Parameter Type Description
$id string
$key string
$value mixed

remove

public remove(string $id, string $key): \App\Infrastructure\Services\Attribute\AttributeBag

Parameters:

Parameter Type Description
$id string
$key string

replaceAll

public replaceAll(string $id, array<string,mixed> $values): \App\Infrastructure\Services\Attribute\AttributeBag

Parameters:

Parameter Type Description
$id string
$values array

merge

public merge(string $id, array<string,mixed> $values): \App\Infrastructure\Services\Attribute\AttributeBag

Parameters:

Parameter Type Description
$id string
$values array

mergeRecursive

public mergeRecursive(string $id, array $values): \App\Infrastructure\Services\Attribute\AttributeBag

Parameters:

Parameter Type Description
$id string
$values array

forget

public forget(string $id): void

Parameters:

Parameter Type Description
$id string

Throws:


warm

public warm(string $id): \App\Infrastructure\Services\Attribute\AttributeBag

Parameters:

Parameter Type Description
$id string

warmMany

public warmMany(list<string> $ids): array<string,\App\Infrastructure\Services\Attribute\AttributeBag>

Parameters:

Parameter Type Description
$ids list

exists

public exists(string $id, string $key): bool

Parameters:

Parameter Type Description
$id string
$key string

load

Warms the cache.

private load(string $id): \App\Infrastructure\Services\Attribute\AttributeBag

Parameters:

Parameter Type Description
$id string

storeWarmCache

private storeWarmCache(string $id, \App\Infrastructure\Services\Attribute\AttributeBag $attribute): void

Parameters:

Parameter Type Description
$id string
$attribute \App\Infrastructure\Services\Attribute\AttributeBag