class NodeType extends ConfigEntityBundleBase implements NodeTypeInterface (View source)

Defines the Node type configuration entity.

Traits

Provides a trait for calculating the dependencies of a plugin.

Provides a trait for accessing synchronization information.

Provides a trait for managing an object's dependencies.

Trait for \Drupal\Core\Cache\RefinableCacheableDependencyInterface.

Provides dependency injection friendly methods for serialization.

Trait for \Drupal\Core\Cache\CacheableDependencyInterface.

Properties

protected string[] $cacheContexts

Cache contexts.

from  CacheableDependencyTrait
protected string[] $cacheTags

Cache tags.

from  CacheableDependencyTrait
protected int $cacheMaxAge

Cache max-age.

from  CacheableDependencyTrait
protected array $_serviceIds

An array of service IDs keyed by property name used for serialization.

from  DependencySerializationTrait
protected array $_entityStorages

An array of entity type IDs keyed by the property name of their storages.

from  DependencySerializationTrait
protected string $entityTypeId

The entity type.

from  EntityBase
protected bool $enforceIsNew

Boolean indicating whether the entity should be forced to be new.

from  EntityBase
protected ComplexDataInterface $typedData

A typed data object wrapping this entity.

from  EntityBase
protected array $dependencies

The object's dependencies.

from  DependencyTrait
protected bool $isSyncing

Whether this entity is being created, updated or deleted through a synchronization process.

from  SynchronizableEntityTrait
protected string $originalId

The original ID of the configuration entity.

from  ConfigEntityBase
protected bool $status

The enabled/disabled status of the configuration entity.

from  ConfigEntityBase
protected string $uuid

The UUID for this entity.

from  ConfigEntityBase
protected string $langcode

The language code of the entity's default language.

from  ConfigEntityBase
protected array $third_party_settings

Third party entity settings.

from  ConfigEntityBase
protected array $_core

Information maintained by Drupal core about configuration.

from  ConfigEntityBase
protected bool $trustedData

Trust supplied data and not use configuration schema on save.

from  ConfigEntityBase
protected string $type

The machine name of this node type.

protected string $name

The human-readable name of the node type.

protected string $description

A brief description of this node type.

protected string $help

Help information shown to the user when creating a Node of this type.

protected bool $new_revision

Default value of the 'Create new revision' checkbox of this node type.

protected int $preview_mode

The preview mode.

protected bool $display_submitted

Display setting for author and date Submitted by post information.

Methods

$this
setCacheability(CacheableDependencyInterface $cacheability)

Sets cacheability; useful for value object constructors.

getCacheTags()

{@inheritdoc}

addCacheableDependency($other_object)

{@inheritdoc}

addCacheContexts(array $cache_contexts)

{@inheritdoc}

addCacheTags(array $cache_tags)

{@inheritdoc}

__sleep()

{@inheritdoc}

__wakeup()

{@inheritdoc}

__construct(array $values, string $entity_type)

Constructs an Entity object.

entityTypeManager()

Gets the entity type manager.

entityTypeBundleInfo()

Gets the entity type bundle info service.

languageManager()

Gets the language manager.

uuidGenerator()

Gets the UUID generator.

string|int|null
id()

Gets the identifier.

string|null
uuid()

Gets the entity UUID (Universally Unique Identifier).

bool
isNew()

Overrides Entity::isNew().

$this
enforceIsNew(bool $value = TRUE)

Enforces an entity to be new.

string
getEntityTypeId()

Gets the ID of the type of the entity.

string
bundle()

Gets the bundle of the entity.

string|TranslatableMarkup|null
label()

Gets the label of the entity.

Url
toUrl(string $rel = 'edit-form', array $options = [])

Gets the URL object for the entity.

bool
hasLinkTemplate($rel)

Indicates if a link template exists for a given key.

array
linkTemplates()

Gets an array link templates.

toLink(string|null $text = NULL, string $rel = 'canonical', array $options = [])

Generates the HTML for a link to this entity.

array
urlRouteParameters(string $rel)

Gets an array of placeholders for this entity.

string[]
uriRelationships()

Gets a list of URI relationships supported by this entity.

access(string $operation, AccountInterface $account = NULL, bool $return_as_object = FALSE)

Checks data value access.

language()

Gets the language of the entity.

int
save()

Saves an entity permanently.

delete()

Deletes an entity permanently.

createDuplicate()

Creates a duplicate of the entity.

getEntityType()

Gets the entity type definition.

preSave(EntityStorageInterface $storage)

Acts on an entity before the presave hook is invoked.

postSave(EntityStorageInterface $storage, bool $update = TRUE)

Acts on a saved entity before the insert or update hook is invoked.

static 
preCreate(EntityStorageInterface $storage, array $values)

Changes the values of an entity before it is created.

postCreate(EntityStorageInterface $storage)

Acts on a created entity before hooks are invoked.

static 
preDelete(EntityStorageInterface $storage, array $entities)

Acts on entities before they are deleted and before hooks are invoked.

static 
postDelete(EntityStorageInterface $storage, array $entities)

Acts on deleted entities before the delete hook is invoked.

static 
postLoad(EntityStorageInterface $storage, array $entities)

Acts on loaded entities.

referencedEntities()

Gets a list of entities referenced by this entity.

string[]
getListCacheTagsToInvalidate()

The list cache tags to invalidate for this entity.

string[]
getCacheTagsToInvalidate()

Returns the cache tags that should be used to invalidate caches.

static EntityInterface|null
load(mixed $id)

Loads an entity.

static EntityInterface[]
loadMultiple(array $ids = NULL)

Loads one or more entities.

static EntityInterface
create(array $values = [])

Constructs a new entity object, without permanently saving it.

invalidateTagsOnSave(bool $update)

Invalidates an entity's cache tags upon save.

static 
invalidateTagsOnDelete(EntityTypeInterface $entity_type, array $entities)

Invalidates an entity's cache tags upon delete.

int|string|null
getOriginalId()

Gets the original ID.

$this
setOriginalId(int|string|null $id)

Sets the original ID.

array
toArray()

Gets an array of all property values.

getTypedData()

Gets a typed data object for this entity object.

string
getConfigDependencyKey()

Gets the key that is used to store configuration dependencies.

string
getConfigDependencyName()

Gets the configuration dependency name.

string
getConfigTarget()

Gets the configuration target identifier for the entity.

$this
addDependency(string $type, string $name)

Adds a dependency.

addDependencies(array $dependencies)

Adds multiple dependencies.

array
getPluginDependencies(PluginInspectionInterface $instance)

Calculates and returns dependencies of a specific plugin instance.

calculatePluginDependencies(PluginInspectionInterface $instance)

Calculates and adds dependencies of a specific plugin instance.

moduleHandler()

Wraps the module handler.

themeHandler()

Wraps the theme handler.

setSyncing($syncing)

{@inheritdoc}

isSyncing()

{@inheritdoc}

mixed
get(string $property_name)

Returns the value of a property.

$this
set(string $property_name, mixed $value)

Sets the value of a property.

$this
enable()

Enables the configuration entity.

$this
disable()

Disables the configuration entity.

$this
setStatus(bool $status)

Sets the status of the configuration entity.

bool
status()

Returns whether the configuration entity is enabled.

setUninstalling($uninstalling)

{@inheritdoc}

bool
isUninstalling()

Returns whether this entity is being changed during the uninstall process.

static 
sort(ConfigEntityInterface $a, ConfigEntityInterface $b)

Helper callback for uasort() to sort configuration entities by weight and label.

getTypedConfig()

Gets the typed config manager.

$this
calculateDependencies()

Calculates dependencies and stores them in the dependency property.

array
getDependencies()

Gets the configuration dependencies.

bool
onDependencyRemoval(array $dependencies)

Informs the entity that entities it depends on will be deleted.

$this
setThirdPartySetting(string $module, string $key, mixed $value)

Sets the value of a third-party setting.

mixed
getThirdPartySetting(string $module, string $key, mixed $default = NULL)

Gets the value of a third-party setting.

array
getThirdPartySettings(string $module)

Gets all third-party settings of a given module.

mixed
unsetThirdPartySetting(string $module, string $key)

Unsets a third-party setting.

array
getThirdPartyProviders()

Gets the list of third parties that store information.

static ConfigManager
getConfigManager()

Gets the configuration manager.

bool
isInstallable()

Checks whether this entity is installable.

$this
trustData()

Sets that the data should be trusted.

bool
hasTrustedData()

Gets whether on not the data is trusted.

deleteDisplays()

Deletes display if a bundle is deleted.

loadDisplays(string $entity_type_id)

Returns view or form displays for this bundle.

string|false
isLocked()

Determines whether the node type is locked.

setNewRevision(bool $new_revision)

Sets whether a new revision should be created by default.

bool
displaySubmitted()

Gets whether 'Submitted by' information should be shown.

setDisplaySubmitted(bool $display_submitted)

Sets whether 'Submitted by' information should be shown.

int
getPreviewMode()

Gets the preview mode.

setPreviewMode(int $preview_mode)

Sets the preview mode.

string
getHelp()

Gets the help information.

string
getDescription()

Gets the description.

bool
shouldCreateNewRevision()

Gets whether a new revision should be created by default.

Details

protected $this setCacheability(CacheableDependencyInterface $cacheability)

Sets cacheability; useful for value object constructors.

Parameters

CacheableDependencyInterface $cacheability

The cacheability to set.

Return Value

$this

getCacheTags()

{@inheritdoc}

getCacheContexts()

{@inheritdoc}

getCacheMaxAge()

{@inheritdoc}

addCacheableDependency($other_object)

{@inheritdoc}

Parameters

$other_object

addCacheContexts(array $cache_contexts)

{@inheritdoc}

Parameters

array $cache_contexts

addCacheTags(array $cache_tags)

{@inheritdoc}

Parameters

array $cache_tags

mergeCacheMaxAge($max_age)

{@inheritdoc}

Parameters

$max_age

__sleep()

{@inheritdoc}

__wakeup()

{@inheritdoc}

__construct(array $values, string $entity_type)

Constructs an Entity object.

Parameters

array $values

An array of values to set, keyed by property name. If the entity type has bundles, the bundle key has to be specified.

string $entity_type

The type of the entity to create.

protected EntityTypeManagerInterface entityTypeManager()

Gets the entity type manager.

protected EntityTypeBundleInfoInterface entityTypeBundleInfo()

Gets the entity type bundle info service.

protected LanguageManagerInterface languageManager()

Gets the language manager.

protected UuidInterface uuidGenerator()

Gets the UUID generator.

Return Value

UuidInterface

string|int|null id()

Gets the identifier.

Return Value

string|int|null

The entity identifier, or NULL if the object does not yet have an identifier.

string|null uuid()

Gets the entity UUID (Universally Unique Identifier).

The UUID is guaranteed to be unique and can be used to identify an entity across multiple systems.

Return Value

string|null

The UUID of the entity, or NULL if the entity does not have one.

bool isNew()

Overrides Entity::isNew().

EntityInterface::enforceIsNew() is only supported for newly created configuration entities but has no effect after saving, since each configuration entity is unique.

Return Value

bool

TRUE if the entity is new, or FALSE if the entity has already been saved.

$this enforceIsNew(bool $value = TRUE)

Enforces an entity to be new.

Allows migrations to create entities with pre-defined IDs by forcing the entity to be new before saving.

Parameters

bool $value

(optional) Whether the entity should be forced to be new. Defaults to TRUE.

Return Value

$this

string getEntityTypeId()

Gets the ID of the type of the entity.

Return Value

string

The entity type ID.

string bundle()

Gets the bundle of the entity.

Return Value

string

The bundle of the entity. Defaults to the entity type ID if the entity type does not make use of different bundles.

string|TranslatableMarkup|null label()

Gets the label of the entity.

Return Value

string|TranslatableMarkup|null

The label of the entity, or NULL if there is no label defined.

Url toUrl(string $rel = 'edit-form', array $options = [])

Gets the URL object for the entity.

The entity must have an id already. Content entities usually get their IDs by saving them.

URI templates might be set in the links array in an annotation, for example:

Parameters

string $rel

The link relationship type, for example: canonical or edit-form.

array $options

See \Drupal\Core\Routing\UrlGeneratorInterface::generateFromRoute() for the available options.

Return Value

Url

The URL object.

Exceptions

EntityMalformedException
UndefinedLinkTemplateException

bool hasLinkTemplate($rel)

Indicates if a link template exists for a given key.

Parameters

$rel

Return Value

bool

TRUE if the link template exists, FALSE otherwise.

protected array linkTemplates()

Gets an array link templates.

Return Value

array

An array of link templates containing paths.

Generates the HTML for a link to this entity.

Parameters

string|null $text

(optional) The link text for the anchor tag as a translated string. If NULL, it will use the entity's label. Defaults to NULL.

string $rel

(optional) The link relationship type. Defaults to 'canonical'.

array $options

See \Drupal\Core\Routing\UrlGeneratorInterface::generateFromRoute() for the available options.

Return Value

Link

A Link to the entity.

Exceptions

EntityMalformedException
UndefinedLinkTemplateException

protected array urlRouteParameters(string $rel)

Gets an array of placeholders for this entity.

Individual entity classes may override this method to add additional placeholders if desired. If so, they should be sure to replicate the property caching logic.

Parameters

string $rel

The link relationship type, for example: canonical or edit-form.

Return Value

array

An array of URI placeholders.

string[] uriRelationships()

Gets a list of URI relationships supported by this entity.

Return Value

string[]

An array of link relationships supported by this entity.

bool|AccessResultInterface access(string $operation, AccountInterface $account = NULL, bool $return_as_object = FALSE)

Checks data value access.

Parameters

string $operation

The operation to be performed.

AccountInterface $account

(optional) The user for which to check access, or NULL to check access for the current user. Defaults to NULL.

bool $return_as_object

(optional) Defaults to FALSE.

Return Value

bool|AccessResultInterface

The access result. Returns a boolean if $return_as_object is FALSE (this is the default) and otherwise an AccessResultInterface object. When a boolean is returned, the result of AccessInterface::isAllowed() is returned, i.e. TRUE means access is explicitly allowed, FALSE means access is either explicitly forbidden or "no opinion".

LanguageInterface language()

Gets the language of the entity.

Return Value

LanguageInterface

The language object.

int save()

Saves an entity permanently.

When saving existing entities, the entity is assumed to be complete, partial updates of entities are not supported.

Return Value

int

Either SAVED_NEW or SAVED_UPDATED, depending on the operation performed.

Exceptions

EntityStorageException

delete()

Deletes an entity permanently.

EntityInterface createDuplicate()

Creates a duplicate of the entity.

Return Value

EntityInterface

A clone of $this with all identifiers unset, so saving it inserts a new entity into the storage system.

EntityTypeInterface getEntityType()

Gets the entity type definition.

Return Value

EntityTypeInterface

The entity type definition.

preSave(EntityStorageInterface $storage)

Acts on an entity before the presave hook is invoked.

Used before the entity is saved and before invoking the presave hook.

Ensure that config entities which are bundles of other entities cannot have their ID changed.

Parameters

EntityStorageInterface $storage

The entity storage object.

Exceptions

ConfigNameException

postSave(EntityStorageInterface $storage, bool $update = TRUE)

Acts on a saved entity before the insert or update hook is invoked.

Used after the entity is saved, but before invoking the insert or update hook. Note that in case of translatable content entities this callback is only fired on their current translation. It is up to the developer to iterate over all translations if needed.

Parameters

EntityStorageInterface $storage

The entity storage object.

bool $update

TRUE if the entity has been updated, or FALSE if it has been inserted.

static preCreate(EntityStorageInterface $storage, array $values)

Changes the values of an entity before it is created.

Load defaults for example.

Parameters

EntityStorageInterface $storage

The entity storage object.

array $values

An array of values to set, keyed by property name. If the entity type has bundles the bundle key has to be specified.

postCreate(EntityStorageInterface $storage)

Acts on a created entity before hooks are invoked.

Used after the entity is created, but before saving the entity and before any of the presave hooks are invoked.

See the @link entity_crud Entity CRUD topic @endlink for more information.

Parameters

EntityStorageInterface $storage

The entity storage object.

static preDelete(EntityStorageInterface $storage, array $entities)

Acts on entities before they are deleted and before hooks are invoked.

Used before the entities are deleted and before invoking the delete hook.

Parameters

EntityStorageInterface $storage

The entity storage object.

array $entities

An array of entities.

static postDelete(EntityStorageInterface $storage, array $entities)

Acts on deleted entities before the delete hook is invoked.

Used after the entities are deleted but before invoking the delete hook.

Parameters

EntityStorageInterface $storage

The entity storage object.

array $entities

An array of entities.

static postLoad(EntityStorageInterface $storage, array $entities)

Acts on loaded entities.

Parameters

EntityStorageInterface $storage

The entity storage object.

array $entities

An array of entities.

EntityInterface[] referencedEntities()

Gets a list of entities referenced by this entity.

Return Value

EntityInterface[]

An array of entities.

protected string[] getListCacheTagsToInvalidate()

The list cache tags to invalidate for this entity.

Return Value

string[]

Set of list cache tags.

string[] getCacheTagsToInvalidate()

Returns the cache tags that should be used to invalidate caches.

This will not return additional cache tags added through addCacheTags().

Return Value

string[]

Set of cache tags.

static EntityInterface|null load(mixed $id)

Loads an entity.

Parameters

mixed $id

The id of the entity to load.

Return Value

EntityInterface|null

The entity object or NULL if there is no entity with the given ID.

static EntityInterface[] loadMultiple(array $ids = NULL)

Loads one or more entities.

Parameters

array $ids

An array of entity IDs, or NULL to load all entities.

Return Value

EntityInterface[]

An array of entity objects indexed by their IDs.

static EntityInterface create(array $values = [])

Constructs a new entity object, without permanently saving it.

Parameters

array $values

(optional) An array of values to set, keyed by property name. If the entity type has bundles, the bundle key has to be specified.

Return Value

EntityInterface

The entity object.

protected invalidateTagsOnSave(bool $update)

Invalidates an entity's cache tags upon save.

Parameters

bool $update

TRUE if the entity has been updated, or FALSE if it has been inserted.

static protected invalidateTagsOnDelete(EntityTypeInterface $entity_type, array $entities)

Invalidates an entity's cache tags upon delete.

Parameters

EntityTypeInterface $entity_type

The entity type definition.

array $entities

An array of entities.

int|string|null getOriginalId()

Gets the original ID.

Return Value

int|string|null

The original ID, or NULL if no ID was set or for entity types that do not support renames.

$this setOriginalId(int|string|null $id)

Sets the original ID.

Parameters

int|string|null $id

The new ID to set as original ID. If the entity supports renames, setting NULL will prevent an update from being considered a rename.

Return Value

$this

array toArray()

Gets an array of all property values.

Return Value

array

An array of property values, keyed by property name.

ComplexDataInterface getTypedData()

Gets a typed data object for this entity object.

The returned typed data object wraps this entity and allows dealing with entities based on the generic typed data API.

Return Value

ComplexDataInterface

The typed data object for this entity.

string getConfigDependencyKey()

Gets the key that is used to store configuration dependencies.

Return Value

string

The key to be used in configuration dependencies when storing dependencies on entities of this type.

string getConfigDependencyName()

Gets the configuration dependency name.

Configuration entities can depend on content and configuration entities. They store an array of content and config dependency names in their "dependencies" key.

Return Value

string

The configuration dependency name.

string getConfigTarget()

Gets the configuration target identifier for the entity.

Used to supply the correct format for storing a reference targeting this entity in configuration.

Return Value

string

The configuration target identifier.

protected $this addDependency(string $type, string $name)

Adds a dependency.

Parameters

string $type

Type of dependency being added: 'module', 'theme', 'config', 'content'.

string $name

If $type is 'module' or 'theme', the name of the module or theme. If $type is 'config' or 'content', the result of EntityInterface::getConfigDependencyName().

Return Value

$this

See also

EntityInterface::getConfigDependencyName

protected addDependencies(array $dependencies)

Adds multiple dependencies.

Parameters

array $dependencies

An array of dependencies keyed by the type of dependency. One example: @code array( 'module' => array( 'node', 'field', 'image', ), ); @endcode

See also

DependencyTrait::addDependency

protected array getPluginDependencies(PluginInspectionInterface $instance)

Calculates and returns dependencies of a specific plugin instance.

Dependencies are added for the module that provides the plugin, as well as any dependencies declared by the instance's calculateDependencies() method, if it implements \Drupal\Component\Plugin\DependentPluginInterface.

Parameters

PluginInspectionInterface $instance

The plugin instance.

Return Value

array

An array of dependencies keyed by the type of dependency.

protected calculatePluginDependencies(PluginInspectionInterface $instance)

Calculates and adds dependencies of a specific plugin instance.

Dependencies are added for the module that provides the plugin, as well as any dependencies declared by the instance's calculateDependencies() method, if it implements \Drupal\Component\Plugin\DependentPluginInterface.

Parameters

PluginInspectionInterface $instance

The plugin instance.

protected ModuleHandlerInterface moduleHandler()

Wraps the module handler.

Return Value

ModuleHandlerInterface

The module handler.

protected ThemeHandlerInterface themeHandler()

Wraps the theme handler.

Return Value

ThemeHandlerInterface

The theme handler.

setSyncing($syncing)

{@inheritdoc}

Parameters

$syncing

isSyncing()

{@inheritdoc}

mixed get(string $property_name)

Returns the value of a property.

Parameters

string $property_name

The name of the property that should be returned.

Return Value

mixed

The property if it exists, or NULL otherwise.

$this set(string $property_name, mixed $value)

Sets the value of a property.

Parameters

string $property_name

The name of the property that should be set.

mixed $value

The value the property should be set to.

Return Value

$this

$this enable()

Enables the configuration entity.

Return Value

$this

$this disable()

Disables the configuration entity.

Return Value

$this

$this setStatus(bool $status)

Sets the status of the configuration entity.

Parameters

bool $status

The status of the configuration entity.

Return Value

$this

bool status()

Returns whether the configuration entity is enabled.

Status implementations for configuration entities should follow these general rules:

  • Status does not affect the loading of entities. I.e. Disabling configuration entities should only have UI/access implications.
  • It should only take effect when a 'status' key is explicitly declared in the entity_keys info of a configuration entity's annotation data.
  • Each entity implementation (entity/controller) is responsible for checking and managing the status.

Return Value

bool

Whether the entity is enabled or not.

setUninstalling($uninstalling)

{@inheritdoc}

Parameters

$uninstalling

bool isUninstalling()

Returns whether this entity is being changed during the uninstall process.

If you are writing code that responds to a change in this entity (insert, update, delete, presave, etc.), and your code would result in a configuration change (whether related to this configuration entity, another configuration entity, or non-entity configuration) or your code would result in a change to this entity itself, you need to check and see if this entity change is part of an uninstall process, and skip executing your code if that is the case.

For example, \Drupal\language\Entity\ConfigurableLanguage::preDelete() prevents the API from deleting the default language. However during an uninstall of the language module it is expected that the default language should be deleted.

Return Value

bool

static sort(ConfigEntityInterface $a, ConfigEntityInterface $b)

Helper callback for uasort() to sort configuration entities by weight and label.

protected TypedConfigManagerInterface getTypedConfig()

Gets the typed config manager.

$this calculateDependencies()

Calculates dependencies and stores them in the dependency property.

Return Value

$this

array getDependencies()

Gets the configuration dependencies.

Return Value

array

An array of dependencies, keyed by $type.

bool onDependencyRemoval(array $dependencies)

Informs the entity that entities it depends on will be deleted.

This method allows configuration entities to remove dependencies instead of being deleted themselves. Configuration entities can use this method to avoid being unnecessarily deleted during an extension uninstallation. For example, entity displays remove references to widgets and formatters if the plugin that supplies them depends on a module that is being uninstalled.

If this method returns TRUE then the entity needs to be re-saved by the caller for the changes to take effect. Implementations should not save the entity.

Parameters

array $dependencies

An array of dependencies that will be deleted keyed by dependency type. Dependency types are, for example, entity, module and theme.

Return Value

bool

TRUE if the entity has been changed as a result, FALSE if not.

$this setThirdPartySetting(string $module, string $key, mixed $value)

Sets the value of a third-party setting.

Parameters

string $module

The module providing the third-party setting.

string $key

The setting name.

mixed $value

The setting value.

Return Value

$this

mixed getThirdPartySetting(string $module, string $key, mixed $default = NULL)

Gets the value of a third-party setting.

Parameters

string $module

The module providing the third-party setting.

string $key

The setting name.

mixed $default

The default value

Return Value

mixed

The value.

array getThirdPartySettings(string $module)

Gets all third-party settings of a given module.

Parameters

string $module

The module providing the third-party settings.

Return Value

array

An array of key-value pairs.

mixed unsetThirdPartySetting(string $module, string $key)

Unsets a third-party setting.

Parameters

string $module

The module providing the third-party setting.

string $key

The setting name.

Return Value

mixed

The value.

array getThirdPartyProviders()

Gets the list of third parties that store information.

Return Value

array

The list of third parties.

static protected ConfigManager getConfigManager()

Gets the configuration manager.

Return Value

ConfigManager

The configuration manager.

bool isInstallable()

Checks whether this entity is installable.

For example, a default view might not be installable if the base table doesn't exist.

Return Value

bool

TRUE if the entity is installable, FALSE otherwise.

$this trustData()

Sets that the data should be trusted.

If the data is trusted then dependencies will not be calculated on save and schema will not be used to cast the values. Generally this is only used during module and theme installation. Once the config entity has been saved the data will no longer be marked as trusted. This is an optimization for creation of configuration during installation.

Return Value

$this

bool hasTrustedData()

Gets whether on not the data is trusted.

Return Value

bool

TRUE if the configuration data is trusted, FALSE if not.

protected deleteDisplays()

Deletes display if a bundle is deleted.

protected EntityDisplayInterface[] loadDisplays(string $entity_type_id)

Returns view or form displays for this bundle.

Parameters

string $entity_type_id

The entity type ID of the display type to load.

Return Value

EntityDisplayInterface[]

A list of matching displays.

string|false isLocked()

Determines whether the node type is locked.

Return Value

string|false

The module name that locks the type or FALSE.

setNewRevision(bool $new_revision)

Sets whether a new revision should be created by default.

Parameters

bool $new_revision

TRUE if a new revision should be created by default.

bool displaySubmitted()

Gets whether 'Submitted by' information should be shown.

Return Value

bool

TRUE if the submitted by information should be shown.

setDisplaySubmitted(bool $display_submitted)

Sets whether 'Submitted by' information should be shown.

Parameters

bool $display_submitted

TRUE if the submitted by information should be shown.

int getPreviewMode()

Gets the preview mode.

Return Value

int

DRUPAL_DISABLED, DRUPAL_OPTIONAL or DRUPAL_REQUIRED.

setPreviewMode(int $preview_mode)

Sets the preview mode.

Parameters

int $preview_mode

DRUPAL_DISABLED, DRUPAL_OPTIONAL or DRUPAL_REQUIRED.

string getHelp()

Gets the help information.

Return Value

string

The help information of this node type.

string getDescription()

Gets the description.

Return Value

string

The description of this node type.

bool shouldCreateNewRevision()

Gets whether a new revision should be created by default.

Return Value

bool

TRUE if a new revision should be created by default.