diff options
Diffstat (limited to 'src/Decorators/ArrayMergeDecorator.php')
-rw-r--r-- | src/Decorators/ArrayMergeDecorator.php | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/src/Decorators/ArrayMergeDecorator.php b/src/Decorators/ArrayMergeDecorator.php new file mode 100644 index 00000000..c40e93b5 --- /dev/null +++ b/src/Decorators/ArrayMergeDecorator.php @@ -0,0 +1,33 @@ +<?php + +/** + * PHPPgAdmin6 + */ + +namespace PHPPgAdmin\Decorators; + +class ArrayMergeDecorator extends Decorator +{ + public $m; + + public function __construct($arrays) + { + $this->m = $arrays; + } + + /** + * @param mixed $fields + * + * @return array + */ + public function value($fields) + { + $accum = []; + + foreach ($this->m as $var) { + $accum = \array_merge($accum, Decorator::get_sanitized_value($var, $fields)); + } + + return $accum; + } +} |