You are here

public function SolrDocumentDefinition::getPropertyDefinitions in Search API Solr 8.2

Same name and namespace in other branches
  1. 8.3 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 67

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
      ->getServerId())) {

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