WooCommerce Code Reference

ArraySearch implements TransformerInterface

Searches a given a given value in the array.

Interfaces, Classes and Traits

TransformerInterface
An interface to define a transformer.

Table of Contents

transform()  : mixed|null
Search a given value in the array.
validate()  : mixed
Validate Transformer arguments.

Methods

transform()

Search a given value in the array.

public transform(mixed $value[, stdClass|null $arguments = null ][, string|null $default_value = null ]) : mixed|null
Parameters
$value : mixed

a value to transform.

$arguments : stdClass|null = null

required argument 'value'.

$default_value : string|null = null

default value.

Tags
throws
InvalidArgumentException

Throws when the required 'value' is missing.

Return values
mixed|null