Insert or update  Bottom

  • Hey, im developing a work-order processing/tracking module for the company i work for but im having some trouble getting an aspect of it to work.

    using DBUtil::insertObject works fine and i can insert an object, but what im looking to do is insert and object if the 'id' field is not set, but if the id field is set update the object. i know with SQL you can literally say insert of update, what dbutil method?

    it's been awhile since i've done anything with zikula and im a little rusty, i apologize for the hiatus my work has taken over my life for the summer, but with the summer coming to an end i should be around more often


    thanks,
    kyle :D
  • its just PHP.

    Code

    if (isset($objId)) {
        DBUtil::updateObject();
    } else {
        DBUtil::insertObject();
    }


    no?
  • In case you're using the PNObject object model, PNObject provides the method save() which does just that.

    Greetings
    R
  • 0 users

This list is based on users active over the last 60 minutes.