public function getData($class, array $params)
{
$file = $this->getPath($class, $this->prefix, $params);
try {
$data = self::loadJson($file);
} catch (FileNotFoundException $e) {
// Some divisions don't have data files, so we don't want to throw the exception
return [];
}
// ToDo: remove this logic from here
if ($class == State::class && isset($params['code'])) {
foreach ($data as $key => $meta) {
if ($meta['parent'] != $params['code']) {
unset($data[$key]);
}
}
}
return $data;
}