Association means linking the different models together in CakePHP.
Relationship Types: There are four type of association types.
Relationship Association Type
one to one hasOne
one to many hasMany
many to one belongsTo
many to many hasAndBelongsToMany
Example: Suppose you are having two different tables named as 'products' and 'categories'. A product belongs to a particular category and a category can have many products. So your association in the Product model will be like as following:
class Product extends AppModel {
public $belongsTo= 'Category';
}
and for category model,your association will be as following:
class Categories extends AppModel{
public $hasMany =array('Product'=>array('className'=>'Product'));
}