Final Class Yiisoft\Data\Db\FieldMapper\ArrayFieldMapper
| Inheritance | Yiisoft\Data\Db\FieldMapper\ArrayFieldMapper |
|---|---|
| Implements | Yiisoft\Data\Db\FieldMapper\FieldMapperInterface |
Maps field names using an array-based mapping configuration.
This mapper uses a predefined array to map field names to database column names or expressions. If a field is not found in the mapping, it returns the original field name.
Public Methods
| Method | Description | Defined By |
|---|---|---|
| __construct() | Yiisoft\Data\Db\FieldMapper\ArrayFieldMapper | |
| map() | Yiisoft\Data\Db\FieldMapper\ArrayFieldMapper |
Method Details
| public mixed __construct ( (\Yiisoft\Db\Expression\ExpressionInterface|string)[] $map ) | ||
| $map | (\Yiisoft\Db\Expression\ExpressionInterface|string)[] |
The field mapping array where keys are field names and values are column names or expressions. For example:
|
public function __construct(
private readonly array $map,
) {}
Signup or Login in order to comment.