yii\helpers\UnsetArrayValue - Yii2 类参考手册

Class yii\helpers\UnsetArrayValue

Inheritanceyii\helpers\UnsetArrayValue
Available since version2.0.10

Object that represents the removal 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\UnsetArrayValue(),
];

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

The result will be

[
    'ids' => [
        1,
        2,
    ],
]

Public Methods

隐藏继承的方法 Hide inherited methods

方法 Method简介 Description定义在 Defined By
__set_state() Restores class state after using var_export(). yii\helpers\UnsetArrayValue

方法详情 Method Details

__set_state() public static method (available since version 2.0.16)

Restores class state after using var_export().

请参阅 \yii\helpers\var_export().

public static yii\helpers\UnsetArrayValue __set_state ( $state )
$state array