Posted by baskoro
In this post, I’d like to give you some review about a book which I just read. This book is about Object Relational Mapping (ORM) in PHP. As we’ve known, PHP is a favourite web programming language, and mostly, they work with a database too. Some programmers use PHP native database API (php-mysql, php-postgresql), another programmers use ADODB to simplify their works. But there is another way to manage your data in RDBMS, you can use Object Relational Mapping. This technique will map you data in your RDBMS into objects in programming language. Any changes made to the object will affect the related data in the RDBMS, and vice versa.
This book explain about Doctrine ORM, which is one of ORM libraries in PHP. As another PacktPub’s books, this book is a technical book with some basic concept. It starts from the basic concept of ORM and how to use Doctrine ORM. And then, in the 2nd chapter, you’ll know how to make a simple blog website with ORM. Building entities, generating getters and setters will be covered in this chapter. It starts from a simple entities with no relationship.
In the next chapter, you’ll learn about relationship in ORM. How to relate an object with another like we usually do in database. And the main thing in this book is covered in the 4th chapter, which is query. ORM without query is useless. With the query explained in this chapter, you wouldn’t use SQL in your web applications again. Although, some basic concept in SQL is also used in ORM’s query.
The last chapter talked about advanced features in Doctrine, such as object inheritance, events, and native queries (just in case you need SQL). This book is an example-based book. Which means you’ll find many example code inside the book. And some of them, wouldn’t be used in a real world applications. You have to – at least – modify it to fulfill your needs. Some basic understanding of PHP, web programming, database, and software engineering diagram are needed to easily understand this book. Especially basic object oriented programming in PHP.
Overall, this is a good book. It’s a simple, example-based, technical book. It’s really suitable for a quick start guide to learn Doctrine ORM in PHP. Though it didn’t tell me how to use Doctrine ORM with popular PHP framework like CodeIgniter or Yii. If you’re interested, you can get the book here.
Maybe you like this post too :