original_string: protected function initializeForModelRoute()
      {
          $this->moduleKey        = $this->routeHelper->getModuleKeyForCurrentRoute();
          $this->modelSlug        = $this->routeHelper->getModelSlugForCurrentRoute();
          $this->permissionPrefix = $this->routeHelper->getPermissionPrefixForModelSlug($this->modelSlug);
  
          if ( ! $this->moduleKey) {
              // @codeCoverageIgnoreStart
              throw new RuntimeException("Could not determine module key for route");
              // @codeCoverageIgnoreEnd
          }
  
          $this->modelInformation = $this->infoRepository->getByKey($this->modelSlug);
  
          if ( ! $this->modelInformation) {
              // @codeCoverageIgnoreStart
              throw new RuntimeException("Could not load information for model key '{$this->modelSlug}'");
              // @codeCoverageIgnoreEnd
          }
  
          $this->routePrefix = $this->routeHelper->getRouteNameForModelClass(
              $this->modelInformation->modelClass(),
              true
          );
  
          return $this;
      }
code: protected function initializeForModelRoute()
      {
          $this->moduleKey        = $this->routeHelper->getModuleKeyForCurrentRoute();
          $this->modelSlug        = $this->routeHelper->getModelSlugForCurrentRoute();
          $this->permissionPrefix = $this->routeHelper->getPermissionPrefixForModelSlug($this->modelSlug);
  
          if ( ! $this->moduleKey) {
              // @codeCoverageIgnoreStart
              throw new RuntimeException("Could not determine module key for route");
              // @codeCoverageIgnoreEnd
          }
  
          $this->modelInformation = $this->infoRepository->getByKey($this->modelSlug);
  
          if ( ! $this->modelInformation) {
              // @codeCoverageIgnoreStart
              throw new RuntimeException("Could not load information for model key '{$this->modelSlug}'");
              // @codeCoverageIgnoreEnd
          }
  
          $this->routePrefix = $this->routeHelper->getRouteNameForModelClass(
              $this->modelInformation->modelClass(),
              true
          );
  
          return $this;
      }
code_tokens: protected function initializeForModelRoute ( ) { $ this -> moduleKey = $ this -> routeHelper -> getModuleKeyForCurrentRoute ( ) ; $ this -> modelSlug = $ this -> routeHelper -> getModelSlugForCurrentRoute ( ) ; $ this -> permissionPrefix = $ this -> routeHelper -> getPermissionPrefixForModelSlug ( $ this -> modelSlug ) ; if ( ! $ this -> moduleKey ) { // @codeCoverageIgnoreStart throw new RuntimeException ( "Could not determine module key for route" ) ; // @codeCoverageIgnoreEnd } $ this -> modelInformation = $ this -> infoRepository -> getByKey ( $ this -> modelSlug ) ; if ( ! $ this -> modelInformation ) { // @codeCoverageIgnoreStart throw new RuntimeException ( "Could not load information for model key '{$this->modelSlug}'" ) ; // @codeCoverageIgnoreEnd } $ this -> routePrefix = $ this -> routeHelper -> getRouteNameForModelClass ( $ this -> modelInformation -> modelClass ( ) , true ) ; return $ this ; }
docstring: Initializes controller and checks context expecting a model route.
  
  @return $this
docstring_tokens: Initializes controller and checks context expecting a model route .