Orm
Orm is short for Object
Relational Mapper which does 2 things: it maps your database table rows to objects and it allows you
to esteblish relations between those objects.
It follows closely the
Active Record Pattern, but was also influenced by other systems.
Relations: Has One
Specifies a one-to-one relationship to another model. The target model must include a "Belongs To" reference to the current model to allow the inverse relationship.
Full config example with defaults as values
// in a Model_User which has one profile
$_has_one = array(
'profile' => array(
'key_from' => 'id',
'model_to' => 'Model_Profile',
'key_to' => 'user_id',
'cascade_save' => true,
'cascade_delete' => false,
)
);