blob: fca85575c74c56f2af30b1063ec79e2e81591b26 (
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']
]);
return ConfigHolder::getRecursiveConfig(true);
}
}
|