/**
  * Returns a service
  * Mayday is raised if service not found.
  *
  * @param string $type
  * @param string $subType
  * @return t3lib_svbase or \TYPO3\CMS\Core\Service\AbstractService
  */
 static function getService($type, $subType = '')
 {
     $service = tx_rnbase::makeInstanceService($type, $subType);
     if (!is_object($service)) {
         tx_rnbase::load('tx_rnbase_util_Misc');
         return self::mayday('Service ' . $type . ' - ' . $subType . ' not found!');
     }
     return $service;
 }
 protected static function callModuleSubparts($template, &$subpartArray, &$wrappedSubpartArray, &$params, &$formatter)
 {
     preg_match_all('!\\<\\!--[a-zA-Z0-9 ]*###([A-Z0-9_\\-|]*)\\###[a-zA-Z0-9 ]*-->!is', $template, $match);
     $allMarkers = array_unique($match[1]);
     foreach ($allMarkers as $marker) {
         if (preg_match('/MARKERMODULE__([A-Z0-9_\\-])*/', $marker)) {
             $module = tx_rnbase::makeInstanceService('markermodule', substr($marker, 14));
             if (is_object($module)) {
                 $subTemplate = $formatter->cObj->getSubpart($template, '###' . $marker . '###');
                 $subpart = $module->parseTemplate($subTemplate, $params, $formatter);
                 if ($subpart !== FALSE) {
                     if (is_array($subpart)) {
                         $wrappedSubpartArray['###' . $marker . '###'] = $subpart;
                     } else {
                         $subpartArray['###' . $marker . '###'] = $subpart;
                     }
                 }
             }
         }
     }
 }