original_string: public function getRepository($className)
      {
          if (isset($this->repositories[$className])) {
              return $this->repositories[$className];
          }
  
          $metadata = $this->getClassMetadata($className);
          $customRepositoryClassName = $metadata->getCustomRepositoryClassName();
  
          if ($customRepositoryClassName !== null) {
              $repository = new $customRepositoryClassName($this, $this->unitOfWork, $metadata);
          } else {
              $repository = new ModelRepository($this, $this->unitOfWork, $metadata);
          }
  
          $this->repositories[$className] = $repository;
  
          return $repository;
      }
code: public function getRepository($className)
      {
          if (isset($this->repositories[$className])) {
              return $this->repositories[$className];
          }
  
          $metadata = $this->getClassMetadata($className);
          $customRepositoryClassName = $metadata->getCustomRepositoryClassName();
  
          if ($customRepositoryClassName !== null) {
              $repository = new $customRepositoryClassName($this, $this->unitOfWork, $metadata);
          } else {
              $repository = new ModelRepository($this, $this->unitOfWork, $metadata);
          }
  
          $this->repositories[$className] = $repository;
  
          return $repository;
      }
code_tokens: public function getRepository ( $ className ) { if ( isset ( $ this -> repositories [ $ className ] ) ) { return $ this -> repositories [ $ className ] ; } $ metadata = $ this -> getClassMetadata ( $ className ) ; $ customRepositoryClassName = $ metadata -> getCustomRepositoryClassName ( ) ; if ( $ customRepositoryClassName !== null ) { $ repository = new $ customRepositoryClassName ( $ this , $ this -> unitOfWork , $ metadata ) ; } else { $ repository = new ModelRepository ( $ this , $ this -> unitOfWork , $ metadata ) ; } $ this -> repositories [ $ className ] = $ repository ; return $ repository ; }
docstring: Returns the model repository instance given by model name.
  
  @param string $className The name of the Model
  
  @return ModelRepository The repository
docstring_tokens: Returns the model repository instance given by model name .