function BaseFieldDefinition::setTargetEntityTypeId
Same name in other branches
- 9 core/lib/Drupal/Core/Field/BaseFieldDefinition.php \Drupal\Core\Field\BaseFieldDefinition::setTargetEntityTypeId()
- 10 core/lib/Drupal/Core/Field/BaseFieldDefinition.php \Drupal\Core\Field\BaseFieldDefinition::setTargetEntityTypeId()
- 11.x core/lib/Drupal/Core/Field/BaseFieldDefinition.php \Drupal\Core\Field\BaseFieldDefinition::setTargetEntityTypeId()
Sets the ID of the type of the entity this field is attached to.
Parameters
string $entity_type_id: The name of the target entity type to set.
Return value
$this
File
-
core/
lib/ Drupal/ Core/ Field/ BaseFieldDefinition.php, line 680
Class
- BaseFieldDefinition
- A class for defining entity fields.
Namespace
Drupal\Core\FieldCode
public function setTargetEntityTypeId($entity_type_id) {
$this->definition['entity_type'] = $entity_type_id;
return $this;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.