- Drupal 8 Module Development
- Daniel Sipos
- 373字
- 2021-07-02 15:45:10
Entities
Progressively, entities have become a very powerful way of modeling data and content in Drupal. The most famous type of entity has always been the Node, and it has been historically the cornerstone of content storage and display. In Drupal 8, the entire entity system has been revamped to make other entity types potentially just as important. They have been brought to the forefront and have been properly connected with other systems.
All entity types can have multiple bundles, which are different variations of the same entity type and can have different fields on them (while sharing some fields).
Drupal core still ships with the Node entity type, with a few bundles such as Basic Page and Article. In addition, it comes with a few other entity types, such as User, Comment, and File. However, creating your own entity type in Drupal 8 has become much more standardized compared to Drupal 7 where contributed modules had to be brought into play.
These are not the only types of entities we have in Drupal 8. The examples mentioned previously are all content entity types. Drupal 8 introduced a new type, configuration entity types. The former are oriented toward content, but in reality, they are for anything that holds data that can be input into the database and is specific to that environment. They are not used for storing configuration, though. Users and content are great examples, as they do not need to be (usually) deployable from one environment to other. The latter, on the other hand, are exportable items of the configuration of which there can be more than one. For example, a content entity bundle is a great example because there can be more than one bundle for a certain entity type; they have some metadata and information stored that can differ from bundle to bundle, and they need to be deployed on all environments. That is, they are fundamental to the correct functioning of the site.
Understanding the entity system is indispensable for doing development in Drupal 8 because it provides a powerful way of modeling custom data and content that goes past the traditional nodes that previously were used and is, in my opinion, too much way past their purpose.
- Java程序設(shè)計(jì)實(shí)戰(zhàn)教程
- ThinkPHP 5實(shí)戰(zhàn)
- 我的第一本算法書
- Python進(jìn)階編程:編寫更高效、優(yōu)雅的Python代碼
- 基于差分進(jìn)化的優(yōu)化方法及應(yīng)用
- Java軟件開發(fā)基礎(chǔ)
- Learning DHTMLX Suite UI
- RabbitMQ Cookbook
- Multithreading in C# 5.0 Cookbook
- Python深度學(xué)習(xí):模型、方法與實(shí)現(xiàn)
- Microsoft Azure Storage Essentials
- 持續(xù)輕量級(jí)Java EE開發(fā):編寫可測試的代碼
- Distributed Computing in Java 9
- Python Programming for Arduino
- 高效使用Greenplum:入門、進(jìn)階與數(shù)據(jù)中臺(tái)