Search code examples
joomlaon-duplicate-key

Using JFactory::getDbo()->insertObject with on duplicate key update


How to use:

JFactory::getDbo()->insertObject('#__card_bonus', $object);

with on duplicate key update ?


Solution

  • JFactory::getDbo()->insertObject('#__card_bonus', $object, $keyName);

    The name of the primary key. If provided the object property is updated. Joomla doc ...