You are here

public function SolrDocumentDefinition::getPropertyDefinitions in Search API Solr 8.3

Same name and namespace in other branches
  1. 8.2 src/TypedData/SolrDocumentDefinition.php \Drupal\search_api_solr\TypedData\SolrDocumentDefinition::getPropertyDefinitions()
  2. 4.x src/TypedData/SolrDocumentDefinition.php \Drupal\search_api_solr\TypedData\SolrDocumentDefinition::getPropertyDefinitions()

Gets an array of property definitions of contained properties.

Return value

\Drupal\Core\TypedData\DataDefinitionInterface[] An array of property definitions of contained properties, keyed by property name.

Overrides ComplexDataDefinitionBase::getPropertyDefinitions

File

src/TypedData/SolrDocumentDefinition.php, line 68

Class

SolrDocumentDefinition
A typed data definition class for describing Solr documents.

Namespace

Drupal\search_api_solr\TypedData

Code

public function getPropertyDefinitions() {
  if (!isset($this->propertyDefinitions)) {
    $this->propertyDefinitions = [];
    if (!empty($this
      ->getIndexId())) {
      $index = Index::load($this
        ->getIndexId());

      /** @var \Drupal\search_api_solr\SolrFieldManagerInterface $field_manager */
      $field_manager = \Drupal::getContainer()
        ->get('solr_field.manager');
      $this->propertyDefinitions = $field_manager
        ->getFieldDefinitions($index);
    }
  }
  return $this->propertyDefinitions;
}