I'm trying to wrap my head around entity framework today. I see you can specify a relationship like this:
However, if the table I have has a column called created_by_user_id, how do I specify the relationship is user -> user_id, but user_id maps to created_by_user_id?
PHP:
$structure->relations = [
'User' => [
'entity' => 'XF:User',
'type' => self::TO_ONE,
'conditions' => 'user_id',
'primary' => true,
]
];
$structure->defaultWith = [
'User'
];
However, if the table I have has a column called created_by_user_id, how do I specify the relationship is user -> user_id, but user_id maps to created_by_user_id?