WooCommerce Code Reference

ContainerInterface

Describes the interface of a container that exposes methods to read its entries.

Table of Contents

get()  : mixed
Finds an entry of the container by its identifier and returns it.
has()  : bool
Returns true if the container can return an entry for the given identifier.

Methods

has()

Returns true if the container can return an entry for the given identifier.

public has(string $id) : bool

Returns false otherwise.

has($id) returning true does not mean that get($id) will not throw an exception. It does however mean that get($id) will not throw a NotFoundExceptionInterface.

Parameters
$id : string

Identifier of the entry to look for.

Return values
bool