id_shorturl; $classname = self::get_class_name($row->shorturl_type); $class = new $classname($id); $class->proceed(); }else{ throw new Exception("Hash not found"); } } protected static function get_class_name($type=""){ if($type && class_exists("shorturl_type_".$type)){ return "shorturl_type_".$type; } throw new Exception("Class not found"); } }