Load extends AbstractStep
Load step class. This class is responsible for loading data files from a specified directory, decoding their contents based on the file extension, and merging the data into the builder's data collection. It supports various file formats such as YAML, JSON, CSV, and XML. The loaded data is organized into a nested array structure based on the file paths and language suffixes.
Table of Contents
Properties
- $builder : Builder
- $canProcess : bool
- $config : Config
- $options : Builder::OPTIONS
- $canProcess : bool
- Configuration options for the step.
Methods
- __construct() : mixed
- StepInterface constructor.
- canProcess() : bool
- Method to know if the step can be processed.
- getName() : string
- Returns the step name.
- init() : void
- This method is called before the step is processed to initialize the step with necessary options and to determine if it can be executed.
- process() : void
- Process implementation.
- pathToArray() : void
- Puts a path/value couple into an array.
Properties
$builder
protected
Builder
$builder
$canProcess
protected
bool
$canProcess
= false
$config
protected
Config
$config
$options
Configuration options for the step.
protected
Builder::OPTIONS
$options
Methods
__construct()
StepInterface constructor.
public
__construct(Builder $builder) : mixed
Parameters
- $builder : Builder
canProcess()
Method to know if the step can be processed.
public
canProcess() : bool
If init() is used, true by default.
Return values
boolgetName()
Returns the step name.
public
getName() : string
Return values
stringinit()
This method is called before the step is processed to initialize the step with necessary options and to determine if it can be executed.
public
init(array<string|int, mixed> $options) : void
Parameters
- $options : array<string|int, mixed>
process()
Process implementation.
public
process() : void
pathToArray()
Puts a path/value couple into an array.
private
pathToArray(array<string|int, mixed> &$arr, string $path, array<string|int, mixed> $value[, string $separator = DIRECTORY_SEPARATOR ]) : void
Parameters
- $arr : array<string|int, mixed>
-
Target array
- $path : string
-
Source path
- $value : array<string|int, mixed>
-
Source values
- $separator : string = DIRECTORY_SEPARATOR
-
Path separator (ie: '/')