Menu

## Containable

Containable.php : 15

### Table of Contents

#### Properties

$context : ContainerInterface|Container|null
  Application container context

#### Methods

__construct() : mixed
contextArrAdd() : void
contextHas() : bool
  Check if a value exists in the container
contextMake() : mixed
  Make an instance of a class from the container. This will throw an exception if the class is not found
contextMakeSilently() : mixed
  Create an instance of a class without throwing an exception when it fails
getOrDefault() : mixed
  Get a value from the container or return a default value
getOrFail() : mixed
  Get a value from the container or throw an exception.
getSilently() : mixed
  Get a value from the container or return null instead of throwing an exception
set() : static
  Set a value in the container

### Properties

#### $context

Containable.php : 25

Application container context

`public ContainerInterface|Container|null $context`

### Methods

#### __construct()

Containable.php : 17
`public __construct([ContainerInterface|Container|null $context = null ]) : mixed`

##### Parameters

$context : ContainerInterface|Container|null = null

#### contextArrAdd()

Containable.php : 117
`public contextArrAdd(string $contextKey, array<string|int, mixed> $dataToAdd) : void`

##### Parameters

$contextKey : string
$dataToAdd : array<string|int, mixed>

#### contextHas()

Containable.php : 33

Check if a value exists in the container

`public contextHas(string $key) : bool`

##### Parameters

$key : string

##### Return values

bool

#### contextMake()

Containable.php : 92

Make an instance of a class from the container. This will throw an exception if the class is not found

`public contextMake(string $name[, array<string|int, mixed> $parameters = [] ]) : mixed`

##### Parameters

$name : string
$parameters : array<string|int, mixed> = []

##### Tags

throws
  DependencyException
throws
  NotFoundException

#### contextMakeSilently()

Containable.php : 103

Create an instance of a class without throwing an exception when it fails

`public contextMakeSilently(string $name[, array<string|int, mixed> $parameters = [] ]) : mixed`

##### Parameters

$name : string
$parameters : array<string|int, mixed> = []

#### getOrDefault()

Containable.php : 65

Get a value from the container or return a default value

`public getOrDefault(string $key, mixed $default) : mixed`

##### Parameters

$key : string
$default : mixed

#### getOrFail()

Containable.php : 82

Get a value from the container or throw an exception.

`public getOrFail(string $key) : mixed`

##### Parameters

$key : string

##### Tags

see
  PioniaApplication::resolve()

  for similar functionality on the application instance

throws
  ContainerExceptionInterface
throws
  DependencyException
throws
  NotFoundException
throws
  NotFoundExceptionInterface

#### getSilently()

Containable.php : 50

Get a value from the container or return null instead of throwing an exception

`public getSilently(mixed $key) : mixed`

##### Parameters

$key : mixed

#### set()

Containable.php : 41

Set a value in the container

`public set(string $name, mixed $value) : static`

##### Parameters

$name : string
$value : mixed

##### Return values

static

## Search results