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

Properties

siteId

private string $siteId

userId

private string $userId

items

private array $items

Methods

__construct

public __construct(string $siteId, string $userId, array<string,mixed> $items = []): mixed

Parameters:

Parameter Type Description
$siteId string
$userId string
$items array

fromArray

public static fromArray(string $siteId, string $userId, array<string,mixed> $attributes): self
  • This method is static. Parameters:
Parameter Type Description
$siteId string
$userId string
$attributes array

empty

public static empty(string $siteId, string $userId): self
  • This method is static. Parameters:
Parameter Type Description
$siteId string
$userId string

fromJson

public static fromJson(string $siteId, string $userId, ?string $json = null): self
  • This method is static. Parameters:
Parameter Type Description
$siteId string
$userId string
$json ?string

siteId

public siteId(): string

userId

public userId(): string

has

public has(string $key): bool

Parameters:

Parameter Type Description
$key string

get

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

Parameters:

Parameter Type Description
$key string
$default mixed

getPath

public getPath(string $path, mixed $default = null): mixed

Parameters:

Parameter Type Description
$path string
$default mixed

string

public string(string $path, string $default = ''): string

Parameters:

Parameter Type Description
$path string
$default string

int

public int(string $path, int $default = 0): int

Parameters:

Parameter Type Description
$path string
$default int

bool

public bool(string $path, bool $default = false): bool

Parameters:

Parameter Type Description
$path string
$default bool

array

public array(string $path, array $default = []): array

Parameters:

Parameter Type Description
$path string
$default array

set

public set(string $key, mixed $value): self

Parameters:

Parameter Type Description
$key string
$value mixed

setPath

public setPath(string $path, mixed $value): self

Parameters:

Parameter Type Description
$path string
$value mixed

remove

public remove(string $key): self

Parameters:

Parameter Type Description
$key string

removePath

public removePath(string $path): self

Parameters:

Parameter Type Description
$path string

merge

public merge(array<string,mixed> $values): self

Parameters:

Parameter Type Description
$values array

mergeRecursive

public mergeRecursive(array<string,mixed> $values): self

Parameters:

Parameter Type Description
$values array

toArray

public toArray(): array<string,mixed>

toJson

public toJson(): string

doMergeRecursive

private doMergeRecursive(array<string,mixed> $left, array<string,mixed> $right): array<string,mixed>

Parameters:

Parameter Type Description
$left array
$right array