You are here

public function Field::setDataDefinition in Search API 8

Sets the field's data definition.

This should mainly be used only when creating a new field object. Calling this on an existing field object might not work as expected.

Parameters

\Drupal\Core\TypedData\DataDefinitionInterface $data_definition: The field's new data definition.

Return value

$this

File

src/Item/Field.php, line 500

Class

Field
Represents a field on a search item that can be indexed.

Namespace

Drupal\search_api\Item

Code

public function setDataDefinition(DataDefinitionInterface $data_definition) {
  $this->dataDefinition = $data_definition;
  return $this;
}