In cakephp v3.x, the Model folder contains 3 folders - Behavior, Entity, Table. I am confused over what kind of code should I put in the Entity and Table files.
Should code related to retrieving data and resultsets be all be placed in the Table files? If yes, what sort of code should one place in the Entity files?
According to the cakephp 3.0 manual, the Model layer has been re-written and replaced. Consider reading the ORM Migration
in order to understand the differences better.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With