original_string: protected function getRelationMappedMorphType($class)
      {
          $map = Relation::morphMap();
  
          if (empty($map)) {
              return ltrim($class, '\\');
          }
  
          if (    false !== ($type = array_search($class, $map))
              ||  false !== ($type = array_search(ltrim($class, '\\'), $map))
          ) {
              return $type;
          }
  
          return trim($class, '\\');
      }
code: protected function getRelationMappedMorphType($class)
      {
          $map = Relation::morphMap();
  
          if (empty($map)) {
              return ltrim($class, '\\');
          }
  
          if (    false !== ($type = array_search($class, $map))
              ||  false !== ($type = array_search(ltrim($class, '\\'), $map))
          ) {
              return $type;
          }
  
          return trim($class, '\\');
      }
code_tokens: protected function getRelationMappedMorphType ( $ class ) { $ map = Relation :: morphMap ( ) ; if ( empty ( $ map ) ) { return ltrim ( $ class , '\\' ) ; } if ( false !== ( $ type = array_search ( $ class , $ map ) ) || false !== ( $ type = array_search ( ltrim ( $ class , '\\' ) , $ map ) ) ) { return $ type ; } return trim ( $ class , '\\' ) ; }
docstring: Returns morph relation type string for a model class, or returns class if not mapped.
  
  @param string $class
  @return string
docstring_tokens: Returns morph relation type string for a model class or returns class if not mapped .