概念
- Entity types:
An entity type is a useful abstraction to group together fields. - Bundles:
Bundles are an implementation of an entity type to which fields can be attached. You can consider bundles as subtypes of an entity type. - Fields:
A field is a reusable piece of content. In technical terms, each field is a primitive data type, with custom validators and widgets for editing and formatters for display. Entity :
An entity would be one instance of a particular entity type such as a comment, taxonomy term or user profile or of a bundle such as a blog post, article or product.
An entity that are used for persistent storage of content and configuration information.Putting this in Object-Oriented Design
・An entity type is a base class
・A bundle is an extended class
・A field is a class member, property, variable or field instance (depending on your naming preference)
・An entity is an object or instance of a base or extended classContent:
Information meant to be displayed on your site: articles, basic pages, images, files, custom blocks, etc. This type of information tends to be relatively permanent, but can normally be edited.- Content entity:
A content entity (or more commonly, entity) is an item of content data, which can consist of text, HTML markup, images, attached files, and other data that is intended to be displayed to site visitors. - Configuration:
Information about your site that is not content, but is also relatively permanent, and is used to define how your site behaves or is displayed. It is sometimes also displayed to site visitors, but tends to be smaller pieces of text (like field labels, the name of your site, etc.) , the content types and views you have defined rather than larger chunks that you’d normally think of as Content. - Configuration entities:
Drupal 8 introduces the concept of configuration entities (or configurables) that leverage the entity system’s CRUD and pluggable storage functionality. The main difference between configuration entities and Drupal 7-style content entities is that configuration entities use the configuration system for storage, rather than the database. They differ from plain configuration in that they are typically user-created, and often need to fire and respond to hooks. Examples of potential configuration entities include:- Content types
- Views
- Taxonomy vocabularies
- Contact forms
- Image styles
Configuration Entity Differences compared to Content Entity
Integrates with CMI API for exportability
No fields
Schema file (Content Entity uses hook_schema())
相关整理
所有entity_type
经常用到的content entities的方法,类,接口的备忘
几种实体类型的实际应用