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

Filter out records based on specific property values. More...

Inheritance diagram for Select:
OptionsResolverComponent Filter ConfigurableComponent ConfigurableComponent

Public Member Functions

 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...
 
- Public Member Functions inherited from OptionsResolverComponent
 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.
More...
 
 getAllConfigurationValues ()
 Retrieve a list of all available configuration values.
Returns
iterable Option values keyed by names.
More...
 

Public Attributes

const OPERATORS
 The comparison operators supported by this filter. More...
 

Protected Member Functions

 optionDefinitions ()
 
- Protected Member Functions inherited from OptionsResolverComponent
 optionDefinitions ()
 List of definition arrays for each option supported by the component. More...
 

Additional Inherited Members

- Protected Attributes inherited from OptionsResolverComponent
 $configuration = []
 Resolved configuration for the component. More...
 
 $resolver
 Use Symfony OptionsResolver as our default configuration manager. More...
 

Detailed Description

Filter out records based on specific property values.

One configuration option is supported, 'criteria', which consists of an array of criterion arrays, each containing three values: the name of the property whose value will be the first operand, one of the comparative operators listed in Select::OPERATORS, and the value for the second operand. Some examples:

// This filter accepts only data records whose id property is equal to 5.
$filter = new Select([
'criteria' => [
['id', '==', 5],
],
]);
// This filter accepts only data records whose status property is equal to 1
// and whose last_name value is in the last half of the alphabet.
$filter = new Select([
'criteria' => [
['status', '==', 1],
['last_name', '>=', 'N'],
],
]);

Member Function Documentation

◆ 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.

◆ optionDefinitions()

optionDefinitions ( )
protected

Member Data Documentation

◆ OPERATORS

const OPERATORS

The comparison operators supported by this filter.