53 lines
878B

  1. <?php
  2. /**
  3. * @link http://www.yiiframework.com/
  4. * @copyright Copyright (c) 2008 Yii Software LLC
  5. * @license http://www.yiiframework.com/license/
  6. */
  7. namespace yii\helpers;
  8. /**
  9. * Object that represents the removal of array value while performing [[ArrayHelper::merge()]].
  10. *
  11. * Usage example:
  12. *
  13. * ```php
  14. * $array1 = [
  15. * 'ids' => [
  16. * 1,
  17. * ],
  18. * 'validDomains' => [
  19. * 'example.com',
  20. * 'www.example.com',
  21. * ],
  22. * ];
  23. *
  24. * $array2 = [
  25. * 'ids' => [
  26. * 2,
  27. * ],
  28. * 'validDomains' => new \yii\helpers\UnsetArrayValue(),
  29. * ];
  30. *
  31. * $result = \yii\helpers\ArrayHelper::merge($array1, $array2);
  32. * ```
  33. *
  34. * The result will be
  35. *
  36. * ```php
  37. * [
  38. * 'ids' => [
  39. * 1,
  40. * 2,
  41. * ],
  42. * ]
  43. * ```
  44. *
  45. * @author Robert Korulczyk <robert@korulczyk.pl>
  46. * @since 2.0.10
  47. */
  48. class UnsetArrayValue
  49. {
  50. }