original_string: protected function translateLocationId($oldLocationId)
      {
          $location = ScoolLocation::where('name',Location::findOrFail($oldLocationId)->name)->first();
          if ( $location != null ) {
              return $location->id;
          }
          throw new LocationNotFoundByNameException();
      }
code: protected function translateLocationId($oldLocationId)
      {
          $location = ScoolLocation::where('name',Location::findOrFail($oldLocationId)->name)->first();
          if ( $location != null ) {
              return $location->id;
          }
          throw new LocationNotFoundByNameException();
      }
code_tokens: protected function translateLocationId ( $ oldLocationId ) { $ location = ScoolLocation :: where ( 'name' , Location :: findOrFail ( $ oldLocationId ) -> name ) -> first ( ) ; if ( $ location != null ) { return $ location -> id ; } throw new LocationNotFoundByNameException ( ) ; }
docstring: Translate location id.
  
  @param $oldLocationId
  @return mixed
  @throws LocationNotFoundByNameException
docstring_tokens: Translate location id .