Entity Manager

Since Kernel version 3.2, it is possible to create an entity manager class in your persistence layer. It will be responsible for saving, updating and deleting data. Using the class, you can separate data from persistence details (Propel).

It is important to not overuse the entity manager or repository for your logic, these two new concepts should only be concerned about data persistence for a entities. Combining multiple calls, making decisions should be done in business layer by delegating calls to corresponding entities/repositories. The side effect of not doing it, will be the business logic creep to persistence layer which will make change hard.

As an example on using an entity manager, see the Blog module.

Related Spryks

You might use the following definitions to generate related code:

  • Add Zed Persistence Entity Manager
  • Add Zed Persistence Entity Manager Interface
  • Add Zed Persistence Entity Manager Interface Method
  • Add Zed Persistence Entity Manager Method

See the Spryk documentation for details.

 

See also:

 

Last review date: Mar. 21st, 2018