NullsOption
Defines constants for the handling of null values in merge operations.
This class standardizes the possible behaviors for null values:
- SKIP : ignore null values when merging if a key exists.
- KEEP : keep null values only if the key does not exist.
- OVERWRITE : overwrite existing values with null.
Tags
Table of Contents
Constants
- KEEP = 'keep'
- Keep null values only if the key does not exist.
- OVERWRITE = 'overwrite'
- Overwrite existing values with null.
- SKIP = 'skip'
- Skip null values when merging (default behavior).
Methods
- all() : array<string|int, string>
- Returns the list of valid options.
- isValid() : bool
- Checks if a given value is a valid null behavior option.
Constants
KEEP
Keep null values only if the key does not exist.
public
mixed
KEEP
= 'keep'
Type: string
OVERWRITE
Overwrite existing values with null.
public
mixed
OVERWRITE
= 'overwrite'
Type: string
SKIP
Skip null values when merging (default behavior).
public
mixed
SKIP
= 'skip'
Type: string
Methods
all()
Returns the list of valid options.
public
static all() : array<string|int, string>
Return values
array<string|int, string>isValid()
Checks if a given value is a valid null behavior option.
public
static isValid(string $value) : bool
Parameters
- $value : string