public static function getByName($name)
{
try {
$class = new self();
$id = $class->getDao()->getIdByName($name);
if ($id) {
return self::getById($id);
} else {
throw new \Exception("There is no class with the name: " . $name);
}
} catch (\Exception $e) {
Logger::error($e);
return null;
}
}