在 cakephp v3.x 中的模型上下文中,table 和实体之间有什么区别以及进入什么样的代码?

What is the difference between a table and entity in the context of Model in cakephp v3.x and what kind of code goes in?

在 cakephp v3.x 中,Model 文件夹包含 3 个文件夹 - Behavior、Entity、Table。我对应该在 Entity 和 Table 文件中放入什么样的代码感到困惑。

是否应该将与检索数据和结果集相关的代码都放在Table 文件中?如果是,实体文件中应该放置什么样的代码?

根据cakephp 3.0 manual, the Model layer has been re-written and replaced. Consider reading the ORM Migration以便更好地理解差异。

Cake\ORM\Table - The main entry point into the new ORM. Provides access to a single table. Handles the definition of association, use of behaviors and creation of entities and query objects.

Cake\ORM\Entity - Represents a single row result. Makes accessing data and serializing to various formats a snap.