RSS Feed/News What does the "primary" key in entity's relation mean?

Status
Not open for further replies.

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
24,696
Points
823

Reputation:

Just trying to wrap my head around a basic concept in XF2. What's the difference between (1) and (2)?

PHP:

Code:
//#1
$structure->relations['Bars'] = [
    'entity'    => 'ABC\DEF:Bar',
    'type'      => self::TO_MANY,
    'conditions' => ['foo_id', '=', '$bar_id'],
    'primary'   => true
];

//#2
$structure->relations['Bars'] = [
    'entity'    => 'ABC\DEF:Bar',
    'type'      => self::TO_MANY,
    'conditions' => ['foo_id', '=', '$bar_id'],
    'primary'   => false
];

And does the...

Read more

Continue reading...
 
Status
Not open for further replies.
Top