nur-sery/nur_src/b/coll/TArrayTools.php

29 lines
606 B
PHP
Raw Normal View History

2023-12-03 22:10:18 +04:00
<?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;
}
}