In this chapter, we will cover the following topics:
Getting data from a database
Defining and using multiple DB connections
Customizing the ActiveQuery class
Processing model fields with AR event-like methods
Automating timestamps
Setting up an author automatically
Setting up a slug automatically
Transactions
Replication and read-write splitting
Implementing single table inheritance
Introduction
In this chapter, you will learn how to work with a database efficiently, when to use models and when not to, how to work with multiple databases, how to automatically preprocess Active Record fields, how to use transactions, and so on.