You are here

public function Comment::setFieldName in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/comment/src/Entity/Comment.php \Drupal\comment\Entity\Comment::setFieldName()

Sets the field ID for which this comment is attached.

Parameters

string $field_name: The field name through which the comment was added.

Return value

$this The class instance that this method is called on.

Overrides CommentInterface::setFieldName

File

core/modules/comment/src/Entity/Comment.php, line 376

Class

Comment
Defines the comment entity class.

Namespace

Drupal\comment\Entity

Code

public function setFieldName($field_name) {
  $this
    ->set('field_name', $field_name);
  return $this;
}