class TestEntityType

Same name in other branches
  1. 8.9.x core/modules/views/tests/src/Unit/EntityViewsDataTest.php \Drupal\Tests\views\Unit\TestEntityType
  2. 10 core/modules/views/tests/src/Kernel/Entity/EntityViewsDataTest.php \Drupal\Tests\views\Kernel\Entity\TestEntityType
  3. 11.x core/modules/views/tests/src/Kernel/Entity/EntityViewsDataTest.php \Drupal\Tests\views\Kernel\Entity\TestEntityType

Entity type class which allows changing the entity keys.

Hierarchy

Expanded class hierarchy of TestEntityType

File

core/modules/views/tests/src/Kernel/Entity/EntityViewsDataTest.php, line 807

Namespace

Drupal\Tests\views\Kernel\Entity
View source
class TestEntityType extends ContentEntityType {
    
    /**
     * Sets a specific entity key.
     *
     * @param string $key
     *   The name of the entity key.
     * @param string $value
     *   The new value of the key.
     *
     * @return $this
     */
    public function setKey($key, $value) {
        $this->entity_keys[$key] = $value;
        return $this;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
ContentEntityType::$revision_metadata_keys protected property An array of entity revision metadata keys.
ContentEntityType::checkStorageClass protected function Overrides EntityType::checkStorageClass
ContentEntityType::getConfigDependencyKey public function Gets the key that is used to store configuration dependencies. Overrides EntityType::getConfigDependencyKey
ContentEntityType::getRevisionMetadataKey public function Gets a specific entity revision metadata key. Overrides ContentEntityTypeInterface::getRevisionMetadataKey
ContentEntityType::getRevisionMetadataKeys public function Gets an array of entity revision metadata keys. Overrides ContentEntityTypeInterface::getRevisionMetadataKeys
ContentEntityType::hasRevisionMetadataKey public function Indicates if a given entity revision metadata key exists. Overrides ContentEntityTypeInterface::hasRevisionMetadataKey
ContentEntityType::setRevisionMetadataKey public function Sets a revision metadata key. Overrides ContentEntityTypeInterface::setRevisionMetadataKey
ContentEntityType::__construct public function Constructs a new EntityType. Overrides EntityType::__construct
DependencySerializationTrait::$_entityStorages protected property
DependencySerializationTrait::$_serviceIds protected property
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
EntityType::$additional protected property Any additional properties and values.
EntityType::$admin_permission protected property The name of the default administrative permission.
EntityType::$base_table protected property The name of the entity type's base table.
EntityType::$bundle_entity_type protected property The name of the entity type which provides bundles.
EntityType::$bundle_label protected property The human-readable name of the entity bundles, e.g. Vocabulary.
EntityType::$bundle_of protected property The name of the entity type for which bundles are provided.
EntityType::$common_reference_target protected property Indicates whether this entity type is commonly used as a reference target.
EntityType::$constraints protected property Entity constraint definitions.
EntityType::$data_table protected property The name of the entity type's data table.
EntityType::$entity_keys protected property An array of entity keys.
EntityType::$field_ui_base_route protected property The route name used by field UI to attach its management pages.
EntityType::$group protected property The machine name of the entity type group.
EntityType::$group_label protected property The human-readable name of the entity type group.
EntityType::$handlers protected property An array of handlers.
EntityType::$id protected property The unique identifier of this entity type. Overrides PluginDefinition::$id
EntityType::$internal protected property Indicates whether the entity data is internal.
EntityType::$label protected property The human-readable name of the type.
EntityType::$label_collection protected property The human-readable label for a collection of entities of the type.
EntityType::$label_count protected property A definite singular/plural name of the type.
EntityType::$label_plural protected property The indefinite plural name of the type.
EntityType::$label_singular protected property The indefinite singular name of the type.
EntityType::$links protected property Link templates using the URI template syntax.
EntityType::$list_cache_contexts protected property The list cache contexts for this entity type.
EntityType::$list_cache_tags protected property The list cache tags for this entity type.
EntityType::$originalClass protected property The name of the original entity type class.
EntityType::$permission_granularity protected property The permission granularity level.
EntityType::$persistent_cache protected property Indicates if the persistent cache of field data should be used.
EntityType::$render_cache protected property Indicates whether the rendered output of entities should be cached.
EntityType::$revision_data_table protected property The name of the entity type's revision data table.
EntityType::$revision_table protected property The name of the entity type's revision table.
EntityType::$show_revision_ui protected property Indicates whether the revision form fields should be added to the form.
EntityType::$static_cache protected property Indicates whether entities should be statically cached. 1
EntityType::$translatable protected property Indicates whether entities of this type have multilingual support.
EntityType::$uri_callback protected property A callable that can be used to provide the entity URI.
EntityType::addConstraint public function Adds a validation constraint. Overrides EntityTypeInterface::addConstraint
EntityType::entityClassImplements public function Indicates if the entity type class implements the given interface. Overrides EntityTypeInterface::entityClassImplements
EntityType::get public function Gets any arbitrary property. Overrides EntityTypeInterface::get
EntityType::getAccessControlClass public function Gets the access control class. Overrides EntityTypeInterface::getAccessControlClass
EntityType::getAdminPermission public function Gets the name of the default administrative permission. Overrides EntityTypeInterface::getAdminPermission
EntityType::getBaseTable public function Gets the name of the entity's base table. Overrides EntityTypeInterface::getBaseTable 1
EntityType::getBundleConfigDependency public function Gets the config dependency info for this entity, if any exists. Overrides EntityTypeInterface::getBundleConfigDependency
EntityType::getBundleEntityType public function Gets the name of the entity type which provides bundles. Overrides EntityTypeInterface::getBundleEntityType
EntityType::getBundleLabel public function Gets the label for the bundle. Overrides EntityTypeInterface::getBundleLabel
EntityType::getBundleOf public function Gets the entity type for which this entity provides bundles. Overrides EntityTypeInterface::getBundleOf
EntityType::getCollectionLabel public function Gets the uppercase plural form of the name of the entity type. Overrides EntityTypeInterface::getCollectionLabel
EntityType::getConstraints public function Gets an array of validation constraints. Overrides EntityTypeInterface::getConstraints
EntityType::getCountLabel public function Gets the label's definite article form for use with a count of entities. Overrides EntityTypeInterface::getCountLabel
EntityType::getDataTable public function Gets the name of the entity's data table. Overrides EntityTypeInterface::getDataTable 1
EntityType::getFormClass public function Gets the form class for a specific operation. Overrides EntityTypeInterface::getFormClass
EntityType::getGroup public function Gets the machine name of the entity type group. Overrides EntityTypeInterface::getGroup
EntityType::getGroupLabel public function Gets the human-readable name of the entity type group. Overrides EntityTypeInterface::getGroupLabel
EntityType::getHandlerClass public function Overrides EntityTypeInterface::getHandlerClass
EntityType::getHandlerClasses public function Gets an array of handlers. Overrides EntityTypeInterface::getHandlerClasses
EntityType::getKey public function Gets a specific entity key. Overrides EntityTypeInterface::getKey
EntityType::getKeys public function Gets an array of entity keys. Overrides EntityTypeInterface::getKeys
EntityType::getLabel public function Gets the human-readable name of the entity type. Overrides EntityTypeInterface::getLabel
EntityType::getLinkTemplate public function Gets the link template for a given key. Overrides EntityTypeInterface::getLinkTemplate
EntityType::getLinkTemplates public function Gets the link templates using the URI template syntax. Overrides EntityTypeInterface::getLinkTemplates
EntityType::getListBuilderClass public function Gets the list class. Overrides EntityTypeInterface::getListBuilderClass
EntityType::getListCacheContexts public function The list cache contexts associated with this entity type. Overrides EntityTypeInterface::getListCacheContexts
EntityType::getListCacheTags public function The list cache tags associated with this entity type. Overrides EntityTypeInterface::getListCacheTags
EntityType::getOriginalClass public function Gets the name of the original entity type class. Overrides EntityTypeInterface::getOriginalClass
EntityType::getPermissionGranularity public function Gets the permission granularity level. Overrides EntityTypeInterface::getPermissionGranularity
EntityType::getPluralLabel public function Gets the indefinite plural form of the name of the entity type. Overrides EntityTypeInterface::getPluralLabel
EntityType::getRevisionDataTable public function Gets the name of the entity's revision data table. Overrides EntityTypeInterface::getRevisionDataTable 1
EntityType::getRevisionTable public function Gets the name of the entity's revision table. Overrides EntityTypeInterface::getRevisionTable 1
EntityType::getRouteProviderClasses public function Gets all the route provide handlers. Overrides EntityTypeInterface::getRouteProviderClasses
EntityType::getSingularLabel public function Gets the indefinite singular form of the name of the entity type. Overrides EntityTypeInterface::getSingularLabel
EntityType::getStorageClass public function Gets the storage class. Overrides EntityTypeInterface::getStorageClass
EntityType::getUriCallback public function Gets a callable that can be used to provide the entity URI. Overrides EntityTypeInterface::getUriCallback
EntityType::getViewBuilderClass public function Gets the view builder class. Overrides EntityTypeInterface::getViewBuilderClass
EntityType::hasFormClasses public function Indicates if this entity type has any forms. Overrides EntityTypeInterface::hasFormClasses
EntityType::hasHandlerClass public function Determines if there is a handler for a given type. Overrides EntityTypeInterface::hasHandlerClass
EntityType::hasKey public function Indicates if a given entity key exists. Overrides EntityTypeInterface::hasKey
EntityType::hasLinkTemplate public function Indicates if a link template exists for a given key. Overrides EntityTypeInterface::hasLinkTemplate
EntityType::hasListBuilderClass public function Indicates if this entity type has a list class. Overrides EntityTypeInterface::hasListBuilderClass
EntityType::hasRouteProviders public function Indicates if this entity type has any route provider. Overrides EntityTypeInterface::hasRouteProviders
EntityType::hasViewBuilderClass public function Indicates if this entity type has a view builder. Overrides EntityTypeInterface::hasViewBuilderClass
EntityType::isCommonReferenceTarget public function Indicates whether this entity type is commonly used as a reference target. Overrides EntityTypeInterface::isCommonReferenceTarget
EntityType::isInternal public function Indicates whether the entity data is internal. Overrides EntityTypeInterface::isInternal
EntityType::isPersistentlyCacheable public function Indicates if the persistent cache of field data should be used. Overrides EntityTypeInterface::isPersistentlyCacheable
EntityType::isRenderCacheable public function Indicates whether the rendered output of entities should be cached. Overrides EntityTypeInterface::isRenderCacheable
EntityType::isRevisionable public function Indicates whether entities of this type have revision support. Overrides EntityTypeInterface::isRevisionable
EntityType::isStaticallyCacheable public function Indicates whether entities should be statically cached. Overrides EntityTypeInterface::isStaticallyCacheable
EntityType::isSubclassOf public function Indicates if the entity type is a subclass of the given class or interface. Overrides EntityTypeInterface::isSubclassOf
EntityType::isTranslatable public function Indicates whether entities of this type have multilingual support. Overrides EntityTypeInterface::isTranslatable
EntityType::set public function Sets a value to an arbitrary property. Overrides EntityTypeInterface::set
EntityType::setAccessClass public function Sets the access control handler class. Overrides EntityTypeInterface::setAccessClass
EntityType::setClass public function Sets the class. Overrides PluginDefinition::setClass
EntityType::setConstraints public function Sets the array of validation constraints for the FieldItemList. Overrides EntityTypeInterface::setConstraints
EntityType::setFormClass public function Sets a form class for a specific operation. Overrides EntityTypeInterface::setFormClass
EntityType::setHandlerClass public function Sets the handlers for a given type. Overrides EntityTypeInterface::setHandlerClass
EntityType::setLinkTemplate public function Sets a single link template. Overrides EntityTypeInterface::setLinkTemplate
EntityType::setListBuilderClass public function Sets the list class. Overrides EntityTypeInterface::setListBuilderClass
EntityType::setStorageClass public function Sets the storage class. Overrides EntityTypeInterface::setStorageClass
EntityType::setUriCallback public function Sets a callable to use to provide the entity URI. Overrides EntityTypeInterface::setUriCallback
EntityType::setViewBuilderClass public function Gets the view builder class. Overrides EntityTypeInterface::setViewBuilderClass
EntityType::showRevisionUi public function Indicates whether the revision form fields should be added to the form. Overrides EntityTypeInterface::showRevisionUi
EntityTypeInterface::BUNDLE_MAX_LENGTH constant The maximum length of bundle name, in characters.
EntityTypeInterface::ID_MAX_LENGTH constant The maximum length of ID, in characters.
PluginDefinition::$class protected property A fully qualified class name.
PluginDefinition::$provider protected property The plugin provider.
PluginDefinition::getClass public function Gets the class. Overrides PluginDefinitionInterface::getClass 1
PluginDefinition::getProvider public function Gets the plugin provider. Overrides PluginDefinitionInterface::getProvider
PluginDefinition::id public function Gets the unique identifier of the plugin. Overrides PluginDefinitionInterface::id 1
StringTranslationTrait::$stringTranslation protected property The string translation service. 3
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.
TestEntityType::setKey public function Sets a specific entity key.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.