<?php
|
|
|
|
namespace App\Handlers;
|
|
|
|
/**
|
|
*
|
|
*
|
|
*
|
|
*/
|
|
|
|
abstract class Handler
|
|
{
|
|
/**
|
|
*
|
|
*
|
|
* @param String $className
|
|
* @return Mixed
|
|
*
|
|
*/
|
|
protected function getHandlerClass(String $className)
|
|
{
|
|
$result = NULL;
|
|
|
|
// create class
|
|
$class = 'App\\Handlers\\'.$className);
|
|
|
|
// if not found check for custom handlers
|
|
if (class_exists($class)) {
|
|
$result = new $class();
|
|
} else {
|
|
|
|
// create class
|
|
$class = 'CustomHandlers\\'.$className;
|
|
|
|
if (class_exists($class)) {
|
|
$result = new $class();
|
|
}
|
|
}
|
|
|
|
return $result;
|
|
}
|
|
}
|