blob: f6ef02dac2ef5a701cbd3f2e4a8cfc7e7c009c03 (
plain) (
tree)
|
|
<?php
class LocationHooks
{
/**
* Resolve baseconfig id to locationid -- noop in this case
*/
public static function baseconfigLocationResolver(int $id): int
{
return $id;
}
/**
* Hook to get inheritance tree for all config vars
* @param int $id Locationid currently being edited
*/
public static function baseconfigInheritance(int $id): array
{
$locs = Location::getLocationsAssoc();
if ($locs === false || !isset($locs[$id]))
return [];
BaseConfig::prepareWithOverrides([
'locationid' => $locs[$id]['parentlocationid'] ?? 0
]);
return ConfigHolder::getRecursiveConfig(true);
}
}
|