Thursday 18 November 2010 9:11:37 am
In this tutorial we will learn how to use CRUD features by extending eZPersistentObject class, so it will be possible to Create, Read, Update, and Delete objects in the database in a straightforward way, without writing SQL queries.
Friends are cool, friendly eZ publish API classes too, one of those classes is the eZPersistentObject, do you know it? No? But you should! You can avoid a lot of headaches with your data living inside a database if you learn how to deal with this class. It is a central class of the eZ publish kernel and is responsible to persist objects to the database without all the complex and boring SQL stuff, by using an Object Oriented approach instead. You can view this class as an abstraction layer between the application and the eZDB database interface, a mediator that makes possible to create, read, update, and remove data in the database without worrying with low-level database code. Almost all the classes that store simple data in the eZ Publish database extend it.
You can see the usage of the eZPersistentObject class in:
When developing complex extensions it will become fundamental to understand this class and its usage(s) so you can use its facilities all the time. In this tutorial we will learn about this class in 3 Steps.
This tutorial is intended for eZ publish intermediate users who know the basics of extension development. It is recommended to have some knowledge about SQL queries , and database transactions.