Discover how to define a new DatabaseObject class to act as a parent class for any subclasses that need to use the active record design pattern. Learn how to move all common behaviors to the parent class and what important adjustments must be made to allo
- [Narrator] We have successfully been able…to implement the active record…design pattern on our bicycle class.…Our bicycle class is able to create, read, update,…and delete records in the database.…So it allows us to work with those database records…in an object oriented way.…That's what the active record design pattern is all about.…In the next chapter we're going to…start working with user authentication.…And we're going to want to have a table of the admin users,…so the store their username and password,…and know who's able to log in.…We're also going to want to have a…content management system for those,…so that we have the ability to create,…read updated and delete our admin users.…
So we could take all of the code we just worked on,…in our bicycle class, we could take it and copy it,…and paste it into an admin class,…so we'd have that same behavior there.…And then if our application gets more robust…and the start adding more features,…we have more tables, we want to implement it again,…we could take that code and copy it and paste it…
Note: This is an intermediate-level training course that assumes you have existing knowledge of PHP. To refresh your skills, check out PHP Essential Training and PHP: Object-Oriented Programming.
- Creating a project database and tables
- Connecting to the database
- Database queries with OOP
- The active record design pattern
- Defining a database-driven class
- Performing common database tasks with OOP
- Creating inheritable and reusable code
- Object-oriented user authentication
- Object-oriented pagination
Skill Level Intermediate
Consuming RESTful APIs in PHP with Guzzlewith Justin Yost2h 12m Intermediate
PHP: Accessing Databases with PDO and MySQLiwith David Powers3h 47m Intermediate
1. Overview and Project Setup
2. The Database Connection
3. Define a Database-Driven Class
4. Object-Oriented CRUD
5. Object-Oriented Authentication
6. Object-Oriented Pagination
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.