'getDataList'
];
}
/**
* Given some pre-defined modules, return the filesystem path of the module.
* @param string $name Name of module to find path of
* @return string
*/
public static function ModulePath($name)
{
// BC for a couple of the key modules in the old syntax. Reduces merge brittleness but can
// be removed before 4.0 stable
$legacyMapping = [
'framework' => 'silverstripe/framework',
'frameworkadmin' => 'silverstripe/admin',
];
if (isset($legacyMapping[$name])) {
$name = $legacyMapping[$name];
}
return ModuleLoader::getModule($name)->getRelativePath();
}
/**
* This allows templates to create a new `DataList` from a known
* DataObject class name, and call methods such as aggregates.
*
* The common use case is for partial caching:
*
* <% cached List(Member).max(LastEdited) %>
* loop members here
* <% end_cached %>
*
*
* @template T of DataObject
* @param class-string $className
* @return DataList
*/
public static function getDataList($className)
{
return DataList::create($className);
}
}