What does the "primary" key in entity's relation mean?

  • Thread starter Thread starter asprin
  • Start date Start date

asprin

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

PHP:

Code:

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...

Read more

Continue reading...
 
Top