<?php
namespace nur\b\coll;

use nur\A;
use nur\valm;
use nur\valx;

trait TArrayTools {
  function A__merge(...$arrays): void {
    A::merge($this->data, ...$arrays);
  }

  function A__select(?array $keys, $default=null): array {
    return A::select($this->data, $keys, $default);
  }

  function X__setAll($dest, ?array $keys=null): array {
    $values = $this->A__select($keys);
    valx::set_values($dest, $values);
    return $values;
  }

  function M__setAll($dest, ?array $keys=null): array {
    $values = $this->A__select($keys);
    valm::set_values($dest, $values);
    return $values;
  }
}
