Soong
Soong provides a general-purpose ETL library for data migration.
TestFilter Class Reference

Simple filter to use in tests. More...

Inheritance diagram for TestFilter:
Filter ConfigurableComponent

Public Member Functions

 getConfigurationValue (string $optionName)
 Retrieve a configuration value for a named option. More...
 
 getAllConfigurationValues ()
 Retrieve a list of all available configuration values. More...
 
 filter (Record $record)
 Decide whether a data record should be processed.
Parameters
\Soong\Contracts\Data\Record$recordRecord to examine.
Returns
bool TRUE if the record should be processed, FALSE if it should be skipped.
More...
 

Detailed Description

Simple filter to use in tests.

One configuration option is supported, 'criteria', which consists of an array containing two values: the name of the property whose value will be checked, and the value to compare it to. Some examples:

// This filter accepts only data records whose id property is equal to 5.
$filter = new Select(['criteria' => ['id', 5]]);

Member Function Documentation

◆ getConfigurationValue()

getConfigurationValue ( string  $optionName)

Retrieve a configuration value for a named option.

Parameters
string$optionNameName of the option to retrieve.
Returns
mixed|null Retrieved value, or NULL if unset.

Implements ConfigurableComponent.

Referenced by TestFilter\filter().

◆ getAllConfigurationValues()

getAllConfigurationValues ( )

Retrieve a list of all available configuration values.

Returns
iterable Option values keyed by names.

Implements ConfigurableComponent.

◆ filter()

filter ( Record  $record)

Decide whether a data record should be processed.

Parameters
\Soong\Contracts\Data\Record$recordRecord to examine.
Returns
bool TRUE if the record should be processed, FALSE if it should be skipped.

Implements Filter.