original_string: public function getSchemaByType($modelClass)
      {
          if (array_key_exists($modelClass, $this->schemaInstances) === true) {
              return $this->schemaInstances[$modelClass];
          }
  
          if ($this->hasSchemaForModelClass($modelClass) === false) {
              throw new InvalidArgumentException("Schema was not registered for model '$modelClass'.");
          }
  
          $schemaClass = $this->model2schemaMap[$modelClass];
          $schema      = new $schemaClass($this->factory, $this);
  
          $this->schemaInstances[$modelClass] = $schema;
  
          return $schema;
      }
code: public function getSchemaByType($modelClass)
      {
          if (array_key_exists($modelClass, $this->schemaInstances) === true) {
              return $this->schemaInstances[$modelClass];
          }
  
          if ($this->hasSchemaForModelClass($modelClass) === false) {
              throw new InvalidArgumentException("Schema was not registered for model '$modelClass'.");
          }
  
          $schemaClass = $this->model2schemaMap[$modelClass];
          $schema      = new $schemaClass($this->factory, $this);
  
          $this->schemaInstances[$modelClass] = $schema;
  
          return $schema;
      }
code_tokens: public function getSchemaByType ( $ modelClass ) { if ( array_key_exists ( $ modelClass , $ this -> schemaInstances ) === true ) { return $ this -> schemaInstances [ $ modelClass ] ; } if ( $ this -> hasSchemaForModelClass ( $ modelClass ) === false ) { throw new InvalidArgumentException ( "Schema was not registered for model '$modelClass'." ) ; } $ schemaClass = $ this -> model2schemaMap [ $ modelClass ] ; $ schema = new $ schemaClass ( $ this -> factory , $ this ) ; $ this -> schemaInstances [ $ modelClass ] = $ schema ; return $ schema ; }
docstring: Get schema provider by resource type.
  
  @param string $modelClass
  
  @return SchemaProviderInterface
docstring_tokens: Get schema provider by resource type .