Skip navigation

We will update our Privacy Policy soon. Please see the preview.

HasOne model associations

HasOne model associations: Learning CakePHP 2
HasOne model associations: Learning CakePHP 2

CakePHP's hasOne model association is used for linking a database table with a primary key into a one-to-many relationship. This tutorial explores the basic hasOne model association, proper hasOne syntax in CakePHP, and setting up the arrays needed to store that property.

Resume Transcript Auto-Scroll
Skill Level Intermediate
4h 55m
Show More Show Less

Q: I can't open the exercise files. What's this .7Z extension?

A: The .7Z extension is for a 7-Zip file. 7-Zip is an open-source file compression standard that is similar to a ZIP file, but it has a much better compression rate in certain situations. For the exercise files in this course, using a standard ZIP file would have added around 150MB to the download size, so we opted for a more efficient format.
To extract the .7Z file, you'll need some free software. If you visit, you can find free, open-source software for Windows. For Mac users, please see to download Keka, a free application that can do the same. For those with software security policies in place, Keka is also available on the Mac App Store for $1.99.

Skills covered in this course
Developer Web Web Development CakePHP

Continue Assessment

You started this assessment previously and didn't complete it. You can pick up where you left off, or start over.

Start My Free Month

Start your free month on LinkedIn Learning, which now features 100% of courses. Develop in-demand skills with access to thousands of expert-led courses on business, tech and creative topics.

Start My Free Month