30 lines
695 B
PHP
30 lines
695 B
PHP
<?php
|
|
namespace nur\config;
|
|
|
|
/**
|
|
* Class RefList: une liste de référence construite avec un chemin de clé de
|
|
* base et une liste de suffixes
|
|
*/
|
|
class RefList extends Ref {
|
|
/** @var array */
|
|
public $pkeys;
|
|
|
|
function __construct(string $base_pkey, string ...$suffixes) {
|
|
parent::__construct("");
|
|
$pkeys = [];
|
|
foreach ($suffixes as $suffix) {
|
|
$pkeys[] = "$base_pkey.$suffix";
|
|
}
|
|
$this->pkeys = $pkeys;
|
|
}
|
|
|
|
function resolve(IConfigManager $cm, string $base_pkey, string $profile) {
|
|
$values = [];
|
|
foreach ($this->pkeys as $pkey) {
|
|
$this->pkey = $pkey;
|
|
$values[] = parent::resolve($cm, $base_pkey, $profile);
|
|
}
|
|
return $values;
|
|
}
|
|
}
|