Revision #3 has been created by Steve Friedl on Apr 26, 2011, 3:07:56 AM with the memo:
Minor wordsmithing
« previous (#2) next (#4) »
Changes
Title
unchanged
Relations: BELONGS_TO versus HAS_ONE
Category
unchanged
FAQs
Yii version
unchanged
Tags
unchanged
relations, HAS_ONE, BELONGS_TO
Content
changed
[...]
PROFILE table
- id
- user_id REFERENCES User.id
- profile_info
~~~
**KEY POINT**: A `BELONGS_TO` relation says that a field in **this** model points to the primary key in **another** model; in this case, _the current model owns the linking field
_.
**KEY POINT**: A `HAS_ONE` relation says that some **other** model has a linking field pointing to **this** model's primary key; in this case,
_the related model owns the linking field
_.
Let's put these in context (numbered for reference)
```php
// Post model relations[...]