A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.yiiframework.com/doc/api/2.0/yii-helpers-replacearrayvalue below:

ReplaceArrayValue, yii\helpers\ReplaceArrayValue | API Documentation for Yii 2.0

Class yii\helpers\ReplaceArrayValue

Object that represents the replacement of array value while performing yii\helpers\ArrayHelper::merge().

Usage example:

$array1 = [
    'ids' => [
        1,
    ],
    'validDomains' => [
        'example.com',
        'www.example.com',
    ],
];

$array2 = [
    'ids' => [
        2,
    ],
    'validDomains' => new \yii\helpers\ReplaceArrayValue([
        'yiiframework.com',
        'www.yiiframework.com',
    ]),
];

$result = \yii\helpers\ArrayHelper::merge($array1, $array2);

The result will be

[
    'ids' => [
        1,
        2,
    ],
    'validDomains' => [
        'yiiframework.com',
        'www.yiiframework.com',
    ],
]
Property Details Method Details

Hide inherited methods

Constructor.

public void __construct ( $value ) $value mixed

Value used as replacement.

Source code

                public function __construct($value)
{
    $this->value = $value;
}

            

Source code

                public static function __set_state($state)
{
    if (!isset($state['value'])) {
        throw new InvalidConfigException('Failed to instantiate class "ReplaceArrayValue". Required parameter "value" is missing');
    }
    return new self($state['value']);
}

            

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4