Drupal 8  8.0.2
Node Class Reference
Inheritance diagram for Node:

Public Member Functions

 preSave (EntityStorageInterface $storage)
 
 preSaveRevision (EntityStorageInterface $storage,\stdClass $record)
 
 postSave (EntityStorageInterface $storage, $update=TRUE)
 
 getType ()
 
 access ($operation= 'view', AccountInterface $account=NULL, $return_as_object=FALSE)
 
 getTitle ()
 
 setTitle ($title)
 
 getCreatedTime ()
 
 setCreatedTime ($timestamp)
 
 isPromoted ()
 
 setPromoted ($promoted)
 
 isSticky ()
 
 setSticky ($sticky)
 
 isPublished ()
 
 setPublished ($published)
 
 getOwner ()
 
 getOwnerId ()
 
 setOwnerId ($uid)
 
 setOwner (UserInterface $account)
 
 getRevisionCreationTime ()
 
 setRevisionCreationTime ($timestamp)
 
 getRevisionAuthor ()
 
 setRevisionAuthorId ($uid)
 
- Public Member Functions inherited from ContentEntityBase
 __construct (array $values, $entity_type, $bundle=FALSE, $translations=array())
 
 postCreate (EntityStorageInterface $storage)
 
 setNewRevision ($value=TRUE)
 
 isNewRevision ()
 
 isDefaultRevision ($new_value=NULL)
 
 isRevisionTranslationAffected ()
 
 setRevisionTranslationAffected ($affected)
 
 isDefaultTranslation ()
 
 getRevisionId ()
 
 isTranslatable ()
 
 preSave (EntityStorageInterface $storage)
 
 preSaveRevision (EntityStorageInterface $storage,\stdClass $record)
 
 validate ()
 
 isValidationRequired ()
 
 setValidationRequired ($required)
 
 __sleep ()
 
 id ()
 
 bundle ()
 
 uuid ()
 
 hasField ($field_name)
 
 get ($field_name)
 
 set ($name, $value, $notify=TRUE)
 
 getFields ($include_computed=TRUE)
 
 getTranslatableFields ($include_computed=TRUE)
 
 getIterator ()
 
 getFieldDefinition ($name)
 
 getFieldDefinitions ()
 
 toArray ()
 
 access ($operation, AccountInterface $account=NULL, $return_as_object=FALSE)
 
 language ()
 
 onChange ($name)
 
 getTranslation ($langcode)
 
 getUntranslated ()
 
 hasTranslation ($langcode)
 
 isNewTranslation ()
 
 removeTranslation ($langcode)
 
 getTranslationLanguages ($include_default=TRUE)
 
 updateOriginalValues ()
 
__get ($name)
 
 __set ($name, $value)
 
 __isset ($name)
 
 __unset ($name)
 
 createDuplicate ()
 
 __clone ()
 
 label ()
 
 referencedEntities ()
 
- Public Member Functions inherited from Entity
 __construct (array $values, $entity_type)
 
 id ()
 
 uuid ()
 
 isNew ()
 
 enforceIsNew ($value=TRUE)
 
 getEntityTypeId ()
 
 bundle ()
 
 label ()
 
 urlInfo ($rel= 'canonical', array $options=[])
 
 toUrl ($rel= 'canonical', array $options=[])
 
 hasLinkTemplate ($rel)
 
 link ($text=NULL, $rel= 'canonical', array $options=[])
 
 toLink ($text=NULL, $rel= 'canonical', array $options=[])
 
 url ($rel= 'canonical', $options=array())
 
 uriRelationships ()
 
 access ($operation, AccountInterface $account=NULL, $return_as_object=FALSE)
 
 language ()
 
 save ()
 
 delete ()
 
 createDuplicate ()
 
 getEntityType ()
 
 preSave (EntityStorageInterface $storage)
 
 postSave (EntityStorageInterface $storage, $update=TRUE)
 
 postCreate (EntityStorageInterface $storage)
 
 referencedEntities ()
 
 getCacheContexts ()
 
 getCacheTagsToInvalidate ()
 
 getCacheTags ()
 
 getCacheMaxAge ()
 
 getOriginalId ()
 
 setOriginalId ($id)
 
 toArray ()
 
 getTypedData ()
 
 __sleep ()
 
 getConfigDependencyKey ()
 
 getConfigDependencyName ()
 
 getConfigTarget ()
 
- Public Member Functions inherited from RefinableCacheableDependencyInterface
 addCacheContexts (array $cache_contexts)
 
 addCacheTags (array $cache_tags)
 
 mergeCacheMaxAge ($max_age)
 
 addCacheableDependency ($other_object)
 
- Public Member Functions inherited from ContentEntityInterface
 hasTranslationChanges ()
 
- Public Member Functions inherited from TranslatableInterface
 addTranslation ($langcode, array $values=array())
 
- Public Member Functions inherited from EntityChangedInterface
 getChangedTime ()
 
 setChangedTime ($timestamp)
 
 getChangedTimeAcrossTranslations ()
 
- Public Member Functions inherited from EntityOwnerInterface
 setOwner (UserInterface $account)
 

Static Public Member Functions

static preDelete (EntityStorageInterface $storage, array $entities)
 
static postDelete (EntityStorageInterface $storage, array $nodes)
 
static baseFieldDefinitions (EntityTypeInterface $entity_type)
 
static getCurrentUserId ()
 
- Static Public Member Functions inherited from ContentEntityBase
static bundleFieldDefinitions (EntityTypeInterface $entity_type, $bundle, array $base_field_definitions)
 
- Static Public Member Functions inherited from Entity
static preCreate (EntityStorageInterface $storage, array &$values)
 
static preDelete (EntityStorageInterface $storage, array $entities)
 
static postDelete (EntityStorageInterface $storage, array $entities)
 
static postLoad (EntityStorageInterface $storage, array &$entities)
 
static load ($id)
 
static loadMultiple (array $ids=NULL)
 
static create (array $values=array())
 
- Static Public Member Functions inherited from FieldableEntityInterface
static baseFieldDefinitions (EntityTypeInterface $entity_type)
 

Data Fields

 $in_preview = NULL
 
- Data Fields inherited from ContentEntityBase
const TRANSLATION_REMOVED = 0
 
const TRANSLATION_EXISTING = 1
 
const TRANSLATION_CREATED = 2
 

Additional Inherited Members

- Protected Member Functions inherited from ContentEntityBase
 getLanguages ()
 
 clearTranslationCache ()
 
 getTranslatedField ($name, $langcode)
 
 setDefaultLangcode ()
 
 updateFieldLangcodes ($langcode)
 
 initializeTranslation ($langcode)
 
 getEntityKey ($key)
 
- Protected Member Functions inherited from Entity
 entityManager ()
 
 entityTypeManager ()
 
 languageManager ()
 
 uuidGenerator ()
 
 linkTemplates ()
 
 urlRouteParameters ($rel)
 
 invalidateTagsOnSave ($update)
 
- Static Protected Member Functions inherited from Entity
static invalidateTagsOnDelete (EntityTypeInterface $entity_type, array $entities)
 
- Protected Attributes inherited from ContentEntityBase
 $values = array()
 
 $fields = array()
 
 $fieldDefinitions
 
 $languages
 
 $langcodeKey
 
 $defaultLangcodeKey
 
 $activeLangcode = LanguageInterface::LANGCODE_DEFAULT
 
 $defaultLangcode
 
 $translations = array()
 
 $translationInitialize = FALSE
 
 $newRevision = FALSE
 
 $isDefaultRevision = TRUE
 
 $entityKeys = array()
 
 $translatableEntityKeys = array()
 
 $validated = FALSE
 
 $validationRequired = FALSE
 
- Protected Attributes inherited from Entity
 $entityTypeId
 
 $enforceIsNew
 
 $typedData
 

Detailed Description

Defines the node entity class.

( id = "node", label = ("Content"), bundle_label = ("Content type"), handlers = { "storage" = "Drupal\node\NodeStorage", "storage_schema" = "Drupal\node\NodeStorageSchema", "view_builder" = "Drupal\node\NodeViewBuilder", "access" = "Drupal\node\NodeAccessControlHandler", "views_data" = "Drupal\node\NodeViewsData", "form" = { "default" = "Drupal\node\NodeForm", "delete" = "Drupal\node\Form\NodeDeleteForm", "edit" = "Drupal\node\NodeForm" }, "route_provider" = { "html" = "Drupal\node\Entity\NodeRouteProvider", }, "list_builder" = "Drupal\node\NodeListBuilder", "translation" = "Drupal\node\NodeTranslationHandler" }, base_table = "node", data_table = "node_field_data", revision_table = "node_revision", revision_data_table = "node_field_revision", translatable = TRUE, list_cache_contexts = { "user.node_grants:view" }, entity_keys = { "id" = "nid", "revision" = "vid", "bundle" = "type", "label" = "title", "langcode" = "langcode", "uuid" = "uuid", "status" = "status", "uid" = "uid", }, bundle_entity_type = "node_type", field_ui_base_route = "entity.node_type.edit_form", common_reference_target = TRUE, permission_granularity = "bundle", links = { "canonical" = "/node/{node}", "delete-form" = "/node/{node}/delete", "edit-form" = "/node/{node}/edit", "version-history" = "/node/{node}/revisions", "revision" = "/node/{node}/revisions/{node_revision}/view", } )

Member Function Documentation

access (   $operation = 'view',
AccountInterface  $account = NULL,
  $return_as_object = FALSE 
)

{}

static baseFieldDefinitions ( EntityTypeInterface  $entity_type)
static

{}

References BaseFieldDefinition\create(), and t().

Here is the call graph for this function:

getCreatedTime ( )

{Gets the node creation timestamp.

Returns
int Creation timestamp of the node.
}

Implements NodeInterface.

static getCurrentUserId ( )
static

Default value callback for 'uid' base field definition.

See Also
::baseFieldDefinitions()
Returns
array An array of default values.

References Drupal\currentUser().

Here is the call graph for this function:

getOwner ( )

{Returns the entity owner's user entity.

Returns
The owner user entity.
}

Implements EntityOwnerInterface.

getOwnerId ( )

{Returns the entity owner's user ID.

Returns
int|null The owner user ID, or NULL in case the user ID field has not been set on the entity.
}

Implements EntityOwnerInterface.

References ContentEntityBase\getEntityKey().

Referenced by Node\preSave().

Here is the call graph for this function:

Here is the caller graph for this function:

getRevisionAuthor ( )

{Gets the node revision author.

Returns
The user entity for the revision author.
}

Implements NodeInterface.

Referenced by Node\preSave().

Here is the caller graph for this function:

getRevisionCreationTime ( )

{Gets the node revision creation timestamp.

Returns
int The UNIX timestamp of when this revision was created.
}

Implements NodeInterface.

getTitle ( )

{Gets the node title.

Returns
string Title of the node.
}

Implements NodeInterface.

getType ( )

{Gets the node type.

Returns
string The node type.
}

Implements NodeInterface.

References ContentEntityBase\bundle().

Here is the call graph for this function:

isPromoted ( )

{Returns the node promotion status.

Returns
bool TRUE if the node is promoted.
}

Implements NodeInterface.

isPublished ( )

{Returns the node published status indicator.Unpublished nodes are only visible to their authors and to administrators.

Returns
bool TRUE if the node is published.
}

Implements NodeInterface.

References ContentEntityBase\getEntityKey().

Here is the call graph for this function:

isSticky ( )

{Returns the node sticky status.

Returns
bool TRUE if the node is sticky.
}

Implements NodeInterface.

static postDelete ( EntityStorageInterface  $storage,
array  $nodes 
)
static

{}

References Drupal\service().

Here is the call graph for this function:

postSave ( EntityStorageInterface  $storage,
  $update = TRUE 
)

{}

References Drupal\entityManager(), and ContentEntityBase\isDefaultRevision().

Here is the call graph for this function:

static preDelete ( EntityStorageInterface  $storage,
array  $entities 
)
static

{}

References Drupal\moduleHandler().

Here is the call graph for this function:

preSave ( EntityStorageInterface  $storage)

{}

References Node\getOwnerId(), Node\getRevisionAuthor(), ContentEntityBase\getTranslation(), ContentEntityBase\getTranslationLanguages(), and Node\setRevisionAuthorId().

Here is the call graph for this function:

preSaveRevision ( EntityStorageInterface  $storage,
\stdClass  $record 
)

{}

References ContentEntityBase\isNewRevision().

Here is the call graph for this function:

setCreatedTime (   $timestamp)

{Sets the node creation timestamp.

Parameters
int$timestampThe node creation timestamp.
Returns
The called node entity.
}

Implements NodeInterface.

References ContentEntityBase\set().

Here is the call graph for this function:

setOwner ( UserInterface  $account)

{}

References ContentEntityBase\set().

Here is the call graph for this function:

setOwnerId (   $uid)

{Sets the entity owner's user ID.

Parameters
int$uidThe owner user id.
Returns
$this
}

Implements EntityOwnerInterface.

References ContentEntityBase\set().

Here is the call graph for this function:

setPromoted (   $promoted)

{Sets the node promoted status.

Parameters
bool$promotedTRUE to set this node to promoted, FALSE to set it to not promoted.
Returns
The called node entity.
}

Implements NodeInterface.

References ContentEntityBase\set().

Here is the call graph for this function:

setPublished (   $published)

{Sets the published status of a node..

Parameters
bool$publishedTRUE to set this node to published, FALSE to set it to unpublished.
Returns
The called node entity.
}

Implements NodeInterface.

References ContentEntityBase\set().

Here is the call graph for this function:

setRevisionAuthorId (   $uid)

{Sets the node revision author.

Parameters
int$uidThe user ID of the revision author.
Returns
The called node entity.
}

Implements NodeInterface.

References ContentEntityBase\set().

Referenced by Node\preSave().

Here is the call graph for this function:

Here is the caller graph for this function:

setRevisionCreationTime (   $timestamp)

{Sets the node revision creation timestamp.

Parameters
int$timestampThe UNIX timestamp of when this revision was created.
Returns
The called node entity.
}

Implements NodeInterface.

References ContentEntityBase\set().

Here is the call graph for this function:

setSticky (   $sticky)

{Sets the node sticky status.

Parameters
bool$stickyTRUE to set this node to sticky, FALSE to set it to not sticky.
Returns
The called node entity.
}

Implements NodeInterface.

References ContentEntityBase\set().

Here is the call graph for this function:

setTitle (   $title)

{Sets the node title.

Parameters
string$titleThe node title.
Returns
The called node entity.
}

Implements NodeInterface.

References ContentEntityBase\set().

Here is the call graph for this function:


The documentation for this class was generated from the following file: