Defines the node entity class.
@Plugin(
id = "node",
label = @Translation("Content"),
module = "node",
controller_class = "Drupal\node\NodeStorageController",
render_controller_class = "Drupal\node\NodeRenderController",
form_controller_class = {
"default" = "Drupal\node\NodeFormController"
},
translation_controller_class = "Drupal\node\NodeTranslationController",
base_table = "node",
revision_table = "node_revision",
uri_callback = "node_uri",
fieldable = TRUE,
entity_keys = {
"id" = "nid",
"revision" = "vid",
"bundle" = "type",
"label" = "title",
"uuid" = "uuid"
},
bundle_keys = {
"bundle" = "type"
},
view_modes = {
"full" = {
"label" = "Full content",
"custom_settings" = FALSE
},
"teaser" = {
"label" = "Teaser",
"custom_settings" = TRUE
},
"rss" = {
"label" = "RSS",
"custom_settings" = FALSE
}
}
)
Expanded class hierarchy of Node
class Node extends Entity implements ContentEntityInterface {
/**
* The node ID.
*
* @var integer
*/
public $nid;
/**
* The node revision ID.
*
* @var integer
*/
public $vid;
/**
* Indicates whether this is the default node revision.
*
* The default revision of a node is the one loaded when no specific revision
* has been specified. Only default revisions are saved to the node table.
*
* @var boolean
*/
public $isDefaultRevision = TRUE;
/**
* The node UUID.
*
* @var string
*/
public $uuid;
/**
* The node content type (bundle).
*
* @var string
*/
public $type;
/**
* The node language code.
*
* @var string
*/
public $langcode = LANGUAGE_NOT_SPECIFIED;
/**
* The node title.
*
* @var string
*/
public $title;
/**
* The node owner's user ID.
*
* @var integer
*/
public $uid;
/**
* The node published status indicator.
*
* Unpublished nodes are only visible to their authors and to administrators.
* The value is either NODE_PUBLISHED or NODE_NOT_PUBLISHED.
*
* @var integer
*/
public $status;
/**
* The node creation timestamp.
*
* @var integer
*/
public $created;
/**
* The node modification timestamp.
*
* @var integer
*/
public $changed;
/**
* The node comment status indicator.
*
* COMMENT_NODE_HIDDEN => no comments
* COMMENT_NODE_CLOSED => comments are read-only
* COMMENT_NODE_OPEN => open (read/write)
*
* @var integer
*/
public $comment;
/**
* The node promotion status.
*
* Promoted nodes should be displayed on the front page of the site. The value
* is either NODE_PROMOTED or NODE_NOT_PROMOTED.
*
* @var integer
*/
public $promote;
/**
* The node sticky status.
*
* Sticky nodes should be displayed at the top of lists in which they appear.
* The value is either NODE_STICKY or NODE_NOT_STICKY.
*
* @var integer
*/
public $sticky;
/**
* The node translation set ID.
*
* Translations sets are based on the ID of the node containing the source
* text for the translation set.
*
* @var integer
*/
public $tnid;
/**
* The node translation status.
*
* If the translation page needs to be updated, the value is 1; otherwise 0.
*
* @var integer
*/
public $translate;
/**
* The node revision creation timestamp.
*
* @var integer
*/
public $revision_timestamp;
/**
* The node revision author's user ID.
*
* @var integer
*/
public $revision_uid;
/**
* Implements Drupal\Core\Entity\EntityInterface::id().
*/
public function id() {
return $this->nid;
}
/**
* Implements Drupal\Core\Entity\EntityInterface::bundle().
*/
public function bundle() {
return $this->type;
}
/**
* Overrides Drupal\Core\Entity\Entity::createDuplicate().
*/
public function createDuplicate() {
$duplicate = parent::createDuplicate();
$duplicate->vid = NULL;
return $duplicate;
}
/**
* Overrides Drupal\Core\Entity\Entity::getRevisionId().
*/
public function getRevisionId() {
return $this->vid;
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Entity:: |
protected | property | Boolean indicating whether the entity should be forced to be new. | |
Entity:: |
protected | property | The entity type. | |
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::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 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 |
Node:: |
public | property | The node modification timestamp. | |
Node:: |
public | property | The node comment status indicator. | |
Node:: |
public | property | The node creation timestamp. | |
Node:: |
public | property |
Indicates whether this is the default node revision. Overrides Entity:: |
|
Node:: |
public | property |
The node language code. Overrides Entity:: |
|
Node:: |
public | property | The node ID. | |
Node:: |
public | property | The node promotion status. | |
Node:: |
public | property | The node revision creation timestamp. | |
Node:: |
public | property | The node revision author's user ID. | |
Node:: |
public | property | The node published status indicator. | |
Node:: |
public | property | The node sticky status. | |
Node:: |
public | property | The node title. | |
Node:: |
public | property | The node translation set ID. | |
Node:: |
public | property | The node translation status. | |
Node:: |
public | property | The node content type (bundle). | |
Node:: |
public | property | The node owner's user ID. | |
Node:: |
public | property | The node UUID. | |
Node:: |
public | property | The node revision ID. | |
Node:: |
public | function |
Implements Drupal\Core\Entity\EntityInterface::bundle(). Overrides Entity:: |
|
Node:: |
public | function |
Overrides Drupal\Core\Entity\Entity::createDuplicate(). Overrides Entity:: |
|
Node:: |
public | function |
Overrides Drupal\Core\Entity\Entity::getRevisionId(). Overrides Entity:: |
|
Node:: |
public | function |
Implements Drupal\Core\Entity\EntityInterface::id(). Overrides Entity:: |