You are here

public function SolrDocumentFactory::create in Search API Solr 4.x

Same name and namespace in other branches
  1. 8.3 src/SolrDocumentFactory.php \Drupal\search_api_solr\SolrDocumentFactory::create()
  2. 8.2 src/SolrDocumentFactory.php \Drupal\search_api_solr\SolrDocumentFactory::create()

Throws

\Drupal\Component\Plugin\Exception\PluginNotFoundException

Overrides SolrDocumentFactoryInterface::create

File

src/SolrDocumentFactory.php, line 42

Class

SolrDocumentFactory
Defines a class for a Solr Document factory.

Namespace

Drupal\search_api_solr

Code

public function create(ItemInterface $item) {
  $plugin = $this->typedDataManager
    ->getDefinition(static::$solrDocument)['class'];
  return $plugin::createFromItem($item);
}