Defines the comment entity class.
@Plugin(
id = "comment",
label = @Translation("Comment"),
module = "comment",
controller_class = "Drupal\comment\CommentStorageController",
render_controller_class = "Drupal\comment\CommentRenderController",
form_controller_class = {
"default" = "Drupal\comment\CommentFormController"
},
translation_controller_class = "Drupal\comment\CommentTranslationController",
base_table = "comment",
uri_callback = "comment_uri",
fieldable = TRUE,
static_cache = FALSE,
entity_keys = {
"id" = "cid",
"bundle" = "node_type",
"label" = "subject",
"uuid" = "uuid"
},
view_modes = {
"full" = {
"label" = "Full comment",
"custom_settings" = FALSE
}
}
)
Expanded class hierarchy of Comment
class Comment extends Entity implements ContentEntityInterface {
/**
* The comment ID.
*
* @var integer
*/
public $cid;
/**
* The comment UUID.
*
* @var string
*/
public $uuid;
/**
* The parent comment ID if this is a reply to a comment.
*
* @var integer
*/
public $pid;
/**
* The ID of the node to which the comment is attached.
*/
public $nid;
/**
* The comment language code.
*
* @var string
*/
public $langcode = LANGUAGE_NOT_SPECIFIED;
/**
* The comment title.
*
* @var string
*/
public $subject;
/**
* The comment author ID.
*
* @var integer
*/
public $uid = 0;
/**
* The comment author's name.
*
* For anonymous authors, this is the value as typed in the comment form.
*
* @var string
*/
public $name = '';
/**
* The comment author's e-mail address.
*
* For anonymous authors, this is the value as typed in the comment form.
*
* @var string
*/
public $mail;
/**
* The comment author's home page address.
*
* For anonymous authors, this is the value as typed in the comment form.
*
* @var string
*/
public $homepage;
/**
* Implements Drupal\Core\Entity\EntityInterface::id().
*/
public function id() {
return $this->cid;
}
/**
* Implements Drupal\Core\Entity\EntityInterface::bundle().
*/
public function bundle() {
return $this->node_type;
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Comment:: |
public | property | The comment ID. | |
Comment:: |
public | property | The comment author's home page address. | |
Comment:: |
public | property |
The comment language code. Overrides Entity:: |
|
Comment:: |
public | property | The comment author's e-mail address. | |
Comment:: |
public | property | The comment author's name. | |
Comment:: |
public | property | The ID of the node to which the comment is attached. | |
Comment:: |
public | property | The parent comment ID if this is a reply to a comment. | |
Comment:: |
public | property | The comment title. | |
Comment:: |
public | property | The comment author ID. | |
Comment:: |
public | property | The comment UUID. | |
Comment:: |
public | function |
Implements Drupal\Core\Entity\EntityInterface::bundle(). Overrides Entity:: |
|
Comment:: |
public | function |
Implements Drupal\Core\Entity\EntityInterface::id(). Overrides Entity:: |
|
Entity:: |
protected | property | Boolean indicating whether the entity should be forced to be new. | |
Entity:: |
protected | property | The entity type. | |
Entity:: |
protected | property | Indicates whether this is the default revision. | 1 |
Entity:: |
protected | property | Boolean indicating whether a new revision should be created on save. | |
Entity:: |
public | function |
Implements AccessibleInterface::access(). Overrides AccessibleInterface:: |
|
Entity:: |
public | function |
Implements EntityInterface::createDuplicate(). Overrides EntityInterface:: |
3 |
Entity:: |
public | function |
Implements EntityInterface::delete(). Overrides EntityInterface:: |
|
Entity:: |
public | function |
Implements EntityInterface::enforceIsNew(). Overrides EntityInterface:: |
|
Entity:: |
public | function |
Implements EntityInterface::entityInfo(). Overrides EntityInterface:: |
|
Entity:: |
public | function |
Implements EntityInterface::entityType(). Overrides EntityInterface:: |
|
Entity:: |
public | function |
Implements EntityInterface::get(). Overrides ComplexDataInterface:: |
2 |
Entity:: |
public | function | Implements ComplexDataInterface::getIterator(). | 1 |
Entity:: |
public | function |
Implements ComplexDataInterface::getProperties(). Overrides ComplexDataInterface:: |
1 |
Entity:: |
public | function |
Implements ComplexDataInterface::getPropertyDefinition(). Overrides ComplexDataInterface:: |
1 |
Entity:: |
public | function |
Implements ComplexDataInterface::getPropertyDefinitions(). Overrides ComplexDataInterface:: |
1 |
Entity:: |
public | function |
Implements ComplexDataInterface::getPropertyValues(). Overrides ComplexDataInterface:: |
1 |
Entity:: |
public | function |
Implements Drupal\Core\Entity\EntityInterface::getRevisionId(). Overrides EntityInterface:: |
3 |
Entity:: |
public | function |
Implements TranslatableInterface::getTranslation(). Overrides TranslatableInterface:: |
1 |
Entity:: |
public | function |
Implements TranslatableInterface::getTranslationLanguages(). Overrides TranslatableInterface:: |
1 |
Entity:: |
public | function |
Implements Drupal\Core\Entity\EntityInterface::isDefaultRevision(). Overrides EntityInterface:: |
1 |
Entity:: |
public | function |
Implements ComplexDataInterface::isEmpty(). Overrides ComplexDataInterface:: |
1 |
Entity:: |
public | function |
Implements EntityInterface::isNew(). Overrides EntityInterface:: |
1 |
Entity:: |
public | function |
Implements EntityInterface::isNewRevision(). Overrides EntityInterface:: |
|
Entity:: |
public | function |
Implements EntityInterface::label(). Overrides EntityInterface:: |
1 |
Entity:: |
public | function |
Implements TranslatableInterface::language(). Overrides TranslatableInterface:: |
1 |
Entity:: |
public | function |
Implements EntityInterface::save(). Overrides EntityInterface:: |
3 |
Entity:: |
public | function |
Implements ComplexDataInterface::set(). Overrides ComplexDataInterface:: |
2 |
Entity:: |
public | function |
Implements EntityInterface::setNewRevision(). Overrides EntityInterface:: |
|
Entity:: |
public | function |
Implements ComplexDataInterface::setPropertyValues(). Overrides ComplexDataInterface:: |
1 |
Entity:: |
public | function | Returns the languages the entity is translated to. | |
Entity:: |
public | function |
Implements EntityInterface::uri(). Overrides EntityInterface:: |
1 |
Entity:: |
public | function |
Implements EntityInterface::uuid(). Overrides EntityInterface:: |
1 |
Entity:: |
public | function | Constructs an Entity object. | 2 |