/** try to include a generic handler class if not yet included.
* Generic implementation, includes Object<pntHandler> for pages and <pntHandler> for parts.
* To be overriden for the inclusion of more specific (but not fully specific) handlers if domain objects are polymorpic
* @param PntRequestHandler $forHandler calling this method
* @param array $requestData like $_REQUEST
* @param string $handler pntHandler string (may be empty)
* @param array $attempted reference to array with results of getTryUseClassTryParams (for debugging)
*/
function ($forHandler, $requestData, $handler, &$attempted) {
$type = isSet($requestData["pntType"]) ? $requestData["pntType"] : null;
$handlerClass = subStr($handler, -4) == 'Part' || !$type
? $handler : "Object$handler";
return $forHandler->($handlerClass, $attempted);
}
|