Falcon::get_handler_class PHP Метод

get_handler_class() публичный статический Метод

Get the registered handler class for a certain type
public static get_handler_class ( string | null $type = null )
$type string | null Type to get, defaults to the option
    public static function get_handler_class($type = null)
    {
        if (!$type) {
            $type = self::get_option('bbsub_handler_type', false);
        }
        $handlers = self::get_handlers();
        if (empty($type)) {
            throw new Exception(__('No handler set in the options', 'bbsub'));
        }
        if (!isset($handlers[$type])) {
            throw new Exception(__('Handler could not be found.', 'bbsub'));
        }
        return $handlers[$type];
    }

Usage Example

Пример #1
0
 /**
  * Validate the handler-specific options via the handler's methods
  *
  * @see self::init()
  */
 public static function validate_handler_options($input)
 {
     if (self::$wipe_handler_options) {
         return array();
     }
     try {
         $handler = Falcon::get_handler_class();
     } catch (Exception $e) {
         return array();
     }
     return $handler::validate_options($input);
 }