original_string: public function getConverter(string $modelClass, string $originalClass = '')
      {
          if ('' === $originalClass) {
              $originalClass = $modelClass;
          }
  
          $converterClass = 'NerdsAndCompany\\Schematic\\Converters\\'.ucfirst(str_replace('craft\\', '', $modelClass));
          $event = new ConverterEvent([
              'modelClass' => $modelClass,
              'converterClass' => $converterClass,
          ]);
  
          $this->trigger(self::EVENT_RESOLVE_CONVERTER, $event);
          $converterClass = $event->converterClass;
  
          if (class_exists($converterClass)) {
              $converter = new $converterClass();
              if ($converter instanceof ConverterInterface) {
                  return $converter;
              }
          }
  
          $parentClass = get_parent_class($modelClass);
          if (!$parentClass) {
              Schematic::error('No converter found for '.$originalClass);
  
              return null;
          }
  
          return $this->getConverter($parentClass, $originalClass);
      }
code: public function getConverter(string $modelClass, string $originalClass = '')
      {
          if ('' === $originalClass) {
              $originalClass = $modelClass;
          }
  
          $converterClass = 'NerdsAndCompany\\Schematic\\Converters\\'.ucfirst(str_replace('craft\\', '', $modelClass));
          $event = new ConverterEvent([
              'modelClass' => $modelClass,
              'converterClass' => $converterClass,
          ]);
  
          $this->trigger(self::EVENT_RESOLVE_CONVERTER, $event);
          $converterClass = $event->converterClass;
  
          if (class_exists($converterClass)) {
              $converter = new $converterClass();
              if ($converter instanceof ConverterInterface) {
                  return $converter;
              }
          }
  
          $parentClass = get_parent_class($modelClass);
          if (!$parentClass) {
              Schematic::error('No converter found for '.$originalClass);
  
              return null;
          }
  
          return $this->getConverter($parentClass, $originalClass);
      }
code_tokens: public function getConverter ( string $ modelClass , string $ originalClass = '' ) { if ( '' === $ originalClass ) { $ originalClass = $ modelClass ; } $ converterClass = 'NerdsAndCompany\\Schematic\\Converters\\' . ucfirst ( str_replace ( 'craft\\' , '' , $ modelClass ) ) ; $ event = new ConverterEvent ( [ 'modelClass' => $ modelClass , 'converterClass' => $ converterClass , ] ) ; $ this -> trigger ( self :: EVENT_RESOLVE_CONVERTER , $ event ) ; $ converterClass = $ event -> converterClass ; if ( class_exists ( $ converterClass ) ) { $ converter = new $ converterClass ( ) ; if ( $ converter instanceof ConverterInterface ) { return $ converter ; } } $ parentClass = get_parent_class ( $ modelClass ) ; if ( ! $ parentClass ) { Schematic :: error ( 'No converter found for ' . $ originalClass ) ; return null ; } return $ this -> getConverter ( $ parentClass , $ originalClass ) ; }
docstring: Find converter for model class.
  
  @param string $modelClass
  
  @return ConverterInterface|null
docstring_tokens: Find converter for model class .